You are here

function book_help in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/book/book.module \book_help()
  2. 4 modules/book.module \book_help()
  3. 5 modules/book/book.module \book_help()
  4. 6 modules/book/book.module \book_help()
  5. 7 modules/book/book.module \book_help()

Implements hook_help().

File

core/modules/book/book.module, line 24
Allows users to create and organize related content in an outline.

Code

function book_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.book':
      $output = '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The Book module is used for creating structured, multi-page content, such as site resource guides, manuals, and wikis. It allows you to create content that has chapters, sections, subsections, or any similarly-tiered structure. Enabling the module creates a new content type <em>Book page</em>. For more information, see the <a href=":book">online documentation for the Book module</a>.', [
        ':book' => 'https://www.drupal.org/documentation/modules/book',
      ]) . '</p>';
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Adding and managing book content') . '</dt>';
      $output .= '<dd>' . t('Books have a hierarchical structure, called a <em>book outline</em>. Each book outline can have nested pages up to nine levels deep. Multiple content types can be configured to behave as a book outline. From the content edit form, it is possible to add a page to a book outline or create a new book.') . '</dd>';
      $output .= '<dd>' . t('You can assign separate permissions for <em>creating new books</em> as well as <em>creating</em>, <em>editing</em> and <em>deleting</em> book content. Users with the <em>Administer book outlines</em> permission can add <em>any</em> type of content to a book by selecting the appropriate book outline while editing the content. They can also view a list of all books, and edit and rearrange section titles on the <a href=":admin-book">Book list page</a>.', [
        ':admin-book' => Url::fromRoute('book.admin')
          ->toString(),
      ]) . '</dd>';
      $output .= '<dt>' . t('Configuring content types for books') . '</dt>';
      $output .= '<dd>' . t('The <em>Book page</em> content type is the initial content type enabled for book outlines. On the <a href=":admin-settings">Book settings page</a> you can configure content types that can used in book outlines.', [
        ':admin-settings' => Url::fromRoute('book.settings')
          ->toString(),
      ]) . '</dd>';
      $output .= '<dd>' . t('Users with the <em>Add content and child pages to books</em> permission will see a link to <em>Add child page</em> when viewing a content item that is part of a book outline. This link will allow users to create a new content item of the content type you select on the <a href=":admin-settings">Book settings page</a>. By default this is the <em>Book page</em> content type.', [
        ':admin-settings' => Url::fromRoute('book.settings')
          ->toString(),
      ]) . '</dd>';
      $output .= '<dt>' . t('Book navigation') . '</dt>';
      $output .= '<dd>' . t("Book pages have a default book-specific navigation block. This navigation block contains links that lead to the previous and next pages in the book, and to the level above the current page in the book's structure. This block can be enabled on the <a href=':admin-block'>Blocks layout page</a>. For book pages to show up in the book navigation, they must be added to a book outline.", [
        ':admin-block' => \Drupal::moduleHandler()
          ->moduleExists('block') ? Url::fromRoute('block.admin_display')
          ->toString() : '#',
      ]) . '</dd>';
      $output .= '<dt>' . t('Collaboration') . '</dt>';
      $output .= '<dd>' . t('Books can be created collaboratively, as they allow users with appropriate permissions to add pages into existing books, and add those pages to a custom table of contents.') . '</dd>';
      $output .= '<dt>' . t('Printing books') . '</dt>';
      $output .= '<dd>' . t("Users with the <em>View printer-friendly books</em> permission can select the <em>printer-friendly version</em> link visible at the bottom of a book page's content to generate a printer-friendly display of the page and all of its subsections.") . '</dd>';
      $output .= '</dl>';
      return $output;
    case 'book.admin':
      return '<p>' . t('The book module offers a means to organize a collection of related content pages, collectively known as a book. When viewed, this content automatically displays links to adjacent book pages, providing a simple navigation system for creating and reviewing structured content.') . '</p>';
    case 'entity.node.book_outline_form':
      return '<p>' . t('The outline feature allows you to include pages in the <a href=":book">Book hierarchy</a>, as well as move them within the hierarchy or to <a href=":book-admin">reorder an entire book</a>.', [
        ':book' => Url::fromRoute('book.render')
          ->toString(),
        ':book-admin' => Url::fromRoute('book.admin')
          ->toString(),
      ]) . '</p>';
  }
}