Skip navigation
Help

book-export-html.tpl.php

  1. drupal
    1. 6 drupal/modules/book/book-export-html.tpl.php
    2. 7 drupal/modules/book/book-export-html.tpl.php

Default theme implementation for printed version of book outline.

Available variables:

  • $title: Top level node title.
  • $head: Header tags.
  • $language: Language code. e.g. "en" for english.
  • $language_rtl: TRUE or FALSE depending on right to left language scripts.
  • $base_url: URL to home page.
  • $contents: Nodes within the current outline rendered through book-node-export-html.tpl.php.

See also

template_preprocess_book_export_html()

1 theme call to book-export-html.tpl.php

File

drupal/modules/book/book-export-html.tpl.php
View source
  1. <?php
  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 code. e.g. "en" for english.
  10. * - $language_rtl: TRUE or FALSE depending on right to left language scripts.
  11. * - $base_url: URL to home page.
  12. * - $contents: Nodes within the current outline rendered through
  13. * book-node-export-html.tpl.php.
  14. *
  15. * @see template_preprocess_book_export_html()
  16. */
  17. ?>
  18. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  19. <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language->language; ?>" xml:lang="<?php print $language->language; ?>">
  20. <head>
  21. <title><?php print $title; ?></title>
  22. <?php print $head; ?>
  23. <base href="<?php print $base_url; ?>" />
  24. <link type="text/css" rel="stylesheet" href="misc/print.css" />
  25. <?php if ($language_rtl): ?>
  26. <link type="text/css" rel="stylesheet" href="misc/print-rtl.css" />
  27. <?php endif; ?>
  28. </head>
  29. <body>
  30. <?php
  31. /**
  32. * The given node is /embedded to its absolute depth in a top level
  33. * section/. For example, a child node with depth 2 in the hierarchy is
  34. * contained in (otherwise empty) &lt;div&gt; elements corresponding to
  35. * depth 0 and depth 1. This is intended to support WYSIWYG output - e.g.,
  36. * level 3 sections always look like level 3 sections, no matter their
  37. * depth relative to the node selected to be exported as printer-friendly
  38. * HTML.
  39. */
  40. $div_close = '';
  41. ?>
  42. <?php for ($i = 1; $i < $depth; $i++) : ?>
  43. <div class="section-<?php print $i; ?>">
  44. <?php $div_close .= '</div>'; ?>
  45. <?php endfor; ?>
  46. <?php print $contents; ?>
  47. <?php print $div_close; ?>
  48. </body>
  49. </html>