You are here

function blocktheme_help in Block Theme 8

Same name and namespace in other branches
  1. 5 blocktheme.module \blocktheme_help()
  2. 6 blocktheme.module \blocktheme_help()
  3. 7 blocktheme.module \blocktheme_help()

Implements hook_help().

File

./blocktheme.module, line 21
Provides a configuration option to select custom themes for blocks

Code

function blocktheme_help($route_name, RouteMatchInterface $route_match) {
  $output = '';
  switch ($route_match
    ->getRouteName()) {
    case 'admin_blocktheme_config':
      $output .= t('BlockTheme allows an admin to define twig files for standard block templates and provides a select box on the block configure form so the user can select a twig file to use as opposed to having to override the templates by block ID.');
      break;
  }
  switch ($route_name) {
    case 'help.page.blocktheme':
      $output .= t('Allows the admin to define re-usable block templates that can be configured from block config screen.');
      $items = array();
      $items[] = \Drupal::l(t('Block Theme'), Url::fromRoute('admin_blocktheme_config'));
      $output .= '<h3>' . t('Block Theme administration pages') . '</h3>';
      $item_list = array(
        '#theme' => 'item_list',
        '#items' => $items,
      );
      $output .= \Drupal::service('renderer')
        ->render($item_list);
      break;
  }
  return $output;
}