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.
I've attached a patch that changes the way the headings are generated in the printable book view. Currently all nodes are given an H1 title regardless of their position in the hierarchy. This makes it hard to determine the node's nesting structure.
Any nodes below at a depth of 6 or more are rendered with a H6. I don't see this as a big problem. I poked around several of the Drupal handbooks and couldn't find any nodes more than 5 levels deep.
Comment | File | Size | Author |
---|---|---|---|
#3 | print_1.css | 2.84 KB | puregin |
book.module_depth_headings.patch | 769 bytes | drewish | |
Comments
Comment #1
puregin CreditAttribution: puregin commentedDrewish, I spent many many hours making the 'printer-friendly' HTML as it is. It's the way it is by design... this is not your grandma's website :) If you look at carefully at the HTML, you will see that the structure is given by the nested DIVs; it is true structure, not hokey HTML 'structure by fiat'.
The section depth is actually given by the depth of the DIV (which is given in its class attribute). This makes styling uniform and easy.
Please review the CVS logs for book module, or the other issues around this, or the dozens of posting on the mailing list to get the background, or contact me off-list.
Best regards, Djun
Comment #2
drewish CreditAttribution: drewish commentedI did notice the DIVs but the lack of default formatting makes it hard to imagine the possibilies. As you noted I don't know the history of the module but the current setup looks... pretty minimal. Considering that most themes don't seem to ship with a printable CSS file it would be helpful to have something that demonstrates what's possible. I'll follow up with you off-thread to see what I can do, but I'd
love to see a better print.css file shipped with Drupal.
Comment #3
puregin CreditAttribution: puregin commentedBingo! I think a nicer print.css is totally the way to go.
I'll quickly attach one I've been using, though I think I'm trying to get too fancy with the run-in headers for level 6 headers.
Comment #4
drewish CreditAttribution: drewish commentedCool, I'll give that a whirl. I'm changing the bug title to reflect the new focus.
I suppose this problem of nested headings will be resolved when everyone finally moves to XHTML 2.0. The switch to <section> and <h> elements will be a huge improvement.
Comment #5
pfaocleComment #6
drummLooks like that CSS file needs to be made into a patch with the commented lines near the top either removed or documented as browser hacks.
Comment #7
deanypop CreditAttribution: deanypop commentedI'm still not seeing any improvements with the print.css file under 5.x... Has anyone* made the changes needed for 'printer-friendly' display of books to be present by default? I'm still seeing the same "everything is H1" style display.
Thanks!
Comment #8
drewish CreditAttribution: drewish commentedComment #9
PanchoThis doesn't seem to be a feature request, but a bug or task. Still needs to be fixed.
Moving to component "drupal.css" as there is no generic css component available in the issue tracker.
Comment #10
sun.core CreditAttribution: sun.core commentedMoving "drupal.css" component issues to "markup".