Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 301977

Restore node theming for book export

$
0
0

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.


Viewing all articles
Browse latest Browse all 301977

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>