Broken node theming for book export

Created on 25 October 2019, about 5 years ago
Updated 7 September 2024, 3 months ago

When you use the "printer friendly version" link for exporting a book hierarchy to HTML, the individual nodes do not use the node template. That is due to this line in BookExport.php function bookNodeExport():

unset($build['#theme']);

Since it is just rendering the contents of the node without using the template, you get 3 problems:

1) The author and created date are always displayed. See #2871251: printer-friendly (always) includes Author username and publish date β†’
2) You get duplicate titles. See #3020279: Book child page titles appear duplicated in printer-friendly version β†’
3) There is no way to fix these problems or make any customizations to the node itself because it does not use the template.

I went looking back in git history and found the source of the problem in #607244-33: Decrease performance impact of contextual links β†’ . I've read the issue and am still not clear what benefit it was supposed to have. By the discussion, it sounds like it wasn't really agreed upon and yet ended up being committed in comment #50. Even if it might have been useful then, that was 10 years ago and a lot has changed. View modes are well developed and people expect to be able to use them and the associated templates.

I propose we reverse this change so that the book nodes go through the normal, expected, theme process.

πŸ› Bug report
Status

Fixed

Version

2.0

Component
BookΒ  β†’

Last updated 19 days ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @pwolanin
Created by

πŸ‡ΊπŸ‡ΈUnited States michelle Wisconsin, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024