You are here

book-export-html.html.twig in Drupal 10

Default theme implementation for printed version of book outline.

Available variables:

  • title: Top level node title.
  • head: Header tags.
  • language: Language object.
  • language_rtl: A flag indicating whether the current display language is a right to left language.
  • base_url: URL to the home page.
  • contents: Nodes within the current outline rendered through book-node-export-html.html.twig.

File

core/modules/book/templates/book-export-html.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for printed version of book outline.
  5. *
  6. * Available variables:
  7. * - title: Top level node title.
  8. * - head: Header tags.
  9. * - language: Language object.
  10. * - language_rtl: A flag indicating whether the current display language is a
  11. * right to left language.
  12. * - base_url: URL to the home page.
  13. * - contents: Nodes within the current outline rendered through
  14. * book-node-export-html.html.twig.
  15. *
  16. * @see template_preprocess_book_export_html()
  17. *
  18. * @ingroup themeable
  19. */
  20. #}
  21. <!DOCTYPE html>
  22. <html{{ html_attributes }}>
  23. <head>
  24. <title>{{ title }}</title>
  25. {{ page.head }}
  26. <base href="{{ base_url }}" />
  27. <link type="text/css" rel="stylesheet" href="misc/print.css" />
  28. </head>
  29. <body>
  30. {#
  31. The given node is embedded to its absolute depth in a top level section.
  32. For example, a child node with depth 2 in the hierarchy is contained in
  33. (otherwise empty) div elements corresponding to depth 0 and depth 1. This
  34. is intended to support WYSIWYG output - e.g., level 3 sections always look
  35. like level 3 sections, no matter their depth relative to the node selected
  36. to be exported as printer-friendly HTML.
  37. #}
  38. {% if depth > 1 %}{% for i in 1..depth-1 %}
  39. <div>
  40. {% endfor %}{% endif %}
  41. {{ contents }}
  42. {% if depth > 1 %}{% for i in 1..depth-1 %}
  43. </div>
  44. {% endfor %}{% endif %}
  45. </body>
  46. </html>

Related topics