book-export-html.html.twig

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.

See also

template_preprocess()

template_preprocess_book_export_html()

1 theme call to book-export-html.html.twig
book_export_html in drupal/core/modules/book/book.pages.inc
Generates HTML for export when invoked by book_export().

File

drupal/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()
  17. * @see template_preprocess_book_export_html()
  18. *
  19. * @ingroup themeable
  20. */
  21. #}
  22. <!DOCTYPE html>
  23. <html{{ html_attributes }}>
  24. <head>
  25. <title>{{ title }}></title>
  26. {{ head }}
  27. <base href="{{ base_url }}" />
  28. <link type="text/css" rel="stylesheet" href="misc/print.css" />
  29. {% if language_rtl %}
  30. <link type="text/css" rel="stylesheet" href="misc/print-rtl.css" />
  31. {% endif %}
  32. </head>
  33. <body>
  34. {#
  35. The given node is embedded to its absolute depth in a top level section.
  36. For example, a child node with depth 2 in the hierarchy is contained in
  37. (otherwise empty) div elements corresponding to depth 0 and depth 1. This
  38. is intended to support WYSIWYG output - e.g., level 3 sections always look
  39. like level 3 sections, no matter their depth relative to the node selected
  40. to be exported as printer-friendly HTML.
  41. #}
  42. {% for i in 1..depth-1 if depth > 1 %}
  43. <div class="section-{{ i }}">
  44. {% endfor %}
  45. {{ contents }}
  46. {% for i in 1..depth-1 if depth > 1 %}
  47. </div>
  48. {% endfor %}
  49. </body>
  50. </html>

Related topics