Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Chris (factoryjoe) wanted to be able to theme node previews differently from the other node views. I decided to add a div around the whole preview area which includes one or two node views, trimmed and not trimmed. And I went ahead and put the whole thing in a themeable function since the is a lot of HTML there.
Comment | File | Size | Author |
---|---|---|---|
node.module_1.diff | 2.34 KB | drumm | |
Comments
Comment #1
rkendall CreditAttribution: rkendall commentedI think this is a good idea. The more themeable the better, as long as there is some sensible overall use of class names etc. ("preview" does make sense to me)
Just one comment/question, does Drupal have some kind of overall plan for the use of HTML class/id names etc.? ...and how div's are nested in the output HTML as well?
I like the idea of as much being themeable by CSS as possible, but maybe we also need to be careful to keep the CSS themeing as simple and consistent as possible - as well.
...just trying to get the bigger picture in mind.
Comment #2
Steven CreditAttribution: Steven commentedApplied to HEAD.
Comment #3
Bèr Kessels CreditAttribution: Bèr Kessels commentedI like the idea, bbut have some small issues:
H3 is not correct. IMO it should be h2
If you use H2 you can even use theme_box, thus reducing the code a lot and re-using general APIS. Also, you will then have less HTML in your code, which is always a good thing.
Bèr
Comment #4
(not verified) CreditAttribution: commented