Skip navigation
Help

book-navigation.tpl.php

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

Default theme implementation to navigate books. Presented under nodes that are a part of book outlines.

Available variables:

  • $tree: The immediate children of the current node rendered as an unordered list.
  • $current_depth: Depth of the current node within the book outline. Provided for context.
  • $prev_url: URL to the previous node.
  • $prev_title: Title of the previous node.
  • $parent_url: URL to the parent node.
  • $parent_title: Title of the parent node. Not printed by default. Provided as an option.
  • $next_url: URL to the next node.
  • $next_title: Title of the next node.
  • $has_links: Flags TRUE whenever the previous, parent or next data has a value.
  • $book_id: The book ID of the current outline being viewed. Same as the node ID containing the entire outline. Provided for context.
  • $book_url: The book/node URL of the current outline being viewed. Provided as an option. Not used by default.
  • $book_title: The book/node title of the current outline being viewed. Provided as an option. Not used by default.

See also

template_preprocess_book_navigation()

1 theme call to book-navigation.tpl.php

File

drupal/modules/book/book-navigation.tpl.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Default theme implementation to navigate books. Presented under nodes that
  5. * are a part of book outlines.
  6. *
  7. * Available variables:
  8. * - $tree: The immediate children of the current node rendered as an
  9. * unordered list.
  10. * - $current_depth: Depth of the current node within the book outline.
  11. * Provided for context.
  12. * - $prev_url: URL to the previous node.
  13. * - $prev_title: Title of the previous node.
  14. * - $parent_url: URL to the parent node.
  15. * - $parent_title: Title of the parent node. Not printed by default. Provided
  16. * as an option.
  17. * - $next_url: URL to the next node.
  18. * - $next_title: Title of the next node.
  19. * - $has_links: Flags TRUE whenever the previous, parent or next data has a
  20. * value.
  21. * - $book_id: The book ID of the current outline being viewed. Same as the
  22. * node ID containing the entire outline. Provided for context.
  23. * - $book_url: The book/node URL of the current outline being viewed.
  24. * Provided as an option. Not used by default.
  25. * - $book_title: The book/node title of the current outline being viewed.
  26. * Provided as an option. Not used by default.
  27. *
  28. * @see template_preprocess_book_navigation()
  29. */
  30. ?>
  31. <?php if ($tree || $has_links): ?>
  32. <div id="book-navigation-<?php print $book_id; ?>" class="book-navigation">
  33. <?php print $tree; ?>
  34. <?php if ($has_links): ?>
  35. <div class="page-links clearfix">
  36. <?php if ($prev_url) : ?>
  37. <a href="<?php print $prev_url; ?>" class="page-previous" title="<?php print t('Go to previous page'); ?>"><?php print t('‹ ') . $prev_title; ?></a>
  38. <?php endif; ?>
  39. <?php if ($parent_url) : ?>
  40. <a href="<?php print $parent_url; ?>" class="page-up" title="<?php print t('Go to parent page'); ?>"><?php print t('up'); ?></a>
  41. <?php endif; ?>
  42. <?php if ($next_url) : ?>
  43. <a href="<?php print $next_url; ?>" class="page-next" title="<?php print t('Go to next page'); ?>"><?php print $next_title . t(' ›'); ?></a>
  44. <?php endif; ?>
  45. </div>
  46. <?php endif; ?>
  47. </div>
  48. <?php endif; ?>