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.

CommentFileSizeAuthor
#3 print_1.css2.84 KBpuregin
book.module_depth_headings.patch769 bytesdrewish
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

puregin’s picture

Drewish, 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

drewish’s picture

I 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.

puregin’s picture

FileSize
2.84 KB

Bingo! 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.

drewish’s picture

Title: Printable book headings should reflect node nesting » Provide better default print.css file

Cool, 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.

pfaocle’s picture

Version: 4.7.0-beta4 » x.y.z
Category: bug » feature
drumm’s picture

Status: Needs review » Needs work

Looks 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.

deanypop’s picture

Version: x.y.z » 5.x-dev

I'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!

drewish’s picture

Version: 5.x-dev » 6.x-dev
Pancho’s picture

Component: book.module » drupal.css
Category: feature » task

This 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.

sun.core’s picture

Component: drupal.css » markup

Moving "drupal.css" component issues to "markup".

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.