[NOTE: THIS ISSUE HAS BEEN RESUBMITTED DUE TO PROBLEM WITH THIS DESCRIPTION BEING TRUNCATED WHEN SUBMITTING THE ORIGINAL TO THIS WEBSITE]

When printing a book using the printer-friendly pages module the heading tags h1,h2,h3 etc. are not correctly output. The book title should be H1 and the pages H2's. Within each page should be a mix of H2's, H3's etc. This output is easy to achieve with the attached patch file which takes the drupal rendered content for each node and remaps the H1,H2,... tags appropriately.

The table of contents is also missing, the attached file creates this TOC based on the heading tags and prepends it to the front of the output before rendering the printable node.

Please can these features be included in the next revision of the code. I have not looked at Drupal 6's functionality as yet due to several modules not being ported to date but maybe this has already been handled there. Will be happy to look at it at a later date though.

The attached is a patchfile for version 5.x-3.6.

CommentFileSizeAuthor
#1 patchfile.patch2.42 KBwsherliker
patchfile.patch2.42 KBwsherliker

Comments

wsherliker’s picture

StatusFileSize
new2.42 KB

Slightly improved so now outputs TOC for sub-sections of books when they are printed on their own (i.e. printing only one chapter of the book).

Note: The patch applies to the print.pages.inc - something I should have mentioned before!

jcnventura’s picture

Status: Active » Needs work

Hi,

Your last patch is incomplete (there's a few lines missing at the end).

Also, the first preg_match is wrong, as it will match against the <hr /> tag.. The pattern should be "!<h[1-6].*>(.*?)</h[1-6]>!si".

It would be really nice if you could use the latest 5.x-dev as your baseline instead of 5.x-3.6, as this would simplify my merging activities.

João

jcnventura’s picture

Status: Needs work » Closed (won't fix)

Well, it seems he went away..

If anyone wants to revive this, feel free. It seems he was the only one asking for it...

João