- Issue created by @joseph.olstad
- Assigned to joseph.olstad
- 🇨🇦Canada joseph.olstad
might be related to something I'm doing in
✨ Book TOC (Table of Contents) RTBC - 🇨🇦Canada joseph.olstad
This was a theming issue.
I resolved by copying this twig from the book module:
book-node-export-html.html.twigto my theme templates/ folder
and then overriding the twig, removing the H1 entry.
Then using theme debug, I created this twig from the suggestions
node--book--print.html.twig
and made my changes.
- 🇨🇦Canada joseph.olstad
actually, could add a little snippet about this in the README
- 🇨🇦Canada joseph.olstad
To get more control of the PDF generated html start by enabling your theme debug in your
sites/default/services.yml
Add this code:
echo print_r($bookHtml, TRUE); die;
in
modules/contrib/book_pdf/src/EventSubscriber/BookPdfPreGenerateSubscriber.php
just after $bookHtml is instantiated in the code.
Rebuild cachesYou'll have to search for theme debug in the rendered output
Mine was
node.html.twig
comming from a parent themeThere's several theming suggestions.
One of them is :node--book--print.html.twig
I modified the twig as desired.
There is another twig also that I modified, this one is provided by core.
core/modules/book/templates/book-node-export-html.html.twig
There were no theme suggestions available, however I simply copied this twig to my custom theme templates/book folder.
Then I modified this twig, in my case, I removed the H1 in this twig.
Adjust your twigs as desired.
- Merge request !7Issue #3474072 by joseph.olstad: Theming documentation for PDFs - Add a README.md. → (Open) created by joseph.olstad