' . t('Getting Started') . '';
$output .= '
' . t('Follow these steps to set up and start using your website:') . '
';
$output .= '';
$output .= '- ' . t('Configure your website Once logged in, visit the Administration page, where you may customize and configure all aspects of your website.', [':admin' => \Drupal::url('system.admin'), ':config' => \Drupal::url('system.admin_config')]) . '
';
$output .= '- ' . t('Enable additional functionality Next, visit the Extend page and enable modules that suit your specific needs. You can find additional modules at the Drupal.org modules page.', [':modules' => \Drupal::url('system.modules_list'), ':download_modules' => 'https://www.drupal.org/project/modules']) . '
';
$output .= '- ' . t('Customize your website design To change the "look and feel" of your website, visit the Appearance page. You may choose from one of the included themes or download additional themes from the Drupal.org themes page.', [':themes' => \Drupal::url('system.themes_page'), ':download_themes' => 'https://www.drupal.org/project/themes']) . '
';
// Display a link to the create content page if Node module is enabled.
if (\Drupal::moduleHandler()->moduleExists('node')) {
$output .= '- ' . t('Start posting content Finally, you may add new content to your website.', [':content' => \Drupal::url('node.add_page')]) . '
';
}
$output .= '
';
$output .= '' . t('For more information, refer to the help listed on this page or to the online documentation and support pages at drupal.org.', [':docs' => 'https://www.drupal.org/documentation', ':support' => 'https://www.drupal.org/support', ':drupal' => 'https://www.drupal.org']) . '
';
return ['#markup' => $output];
case 'help.page.help':
$output = '';
$output .= '' . t('About') . '
';
$output .= '' . t('The Help module generates Help reference pages to guide you through the use and configuration of modules, and provides a Help block with page-level help. The reference pages are a starting point for Drupal.org online documentation pages that contain more extensive and up-to-date information, are annotated with user-contributed comments, and serve as the definitive reference point for all Drupal documentation. For more information, see the online documentation for the Help module.', [':help' => 'https://www.drupal.org/documentation/modules/help/', ':handbook' => 'https://www.drupal.org/documentation', ':help-page' => \Drupal::url('help.main')]) . '
';
$output .= '' . t('Uses') . '
';
$output .= '';
$output .= '- ' . t('Providing a help reference') . '
';
$output .= '- ' . t('The Help module displays explanations for using each module listed on the main Help reference page.', [':help' => \Drupal::url('help.main')]) . '
';
$output .= '- ' . t('Providing page-specific help') . '
';
$output .= '- ' . t('Page-specific help text provided by modules is displayed in the Help block. This block can be placed and configured on the Block layout page.', [':blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? \Drupal::url('block.admin_display') : '#']) . '
';
$output .= '
';
return ['#markup' => $output];
}
}
/**
* Implements hook_theme().
*/
function help_theme($existing, $type, $theme, $path) {
return [
'help_section' => [
'variables' => [
'title' => NULL,
'description' => NULL,
'links' => NULL,
'empty' => NULL,
],
],
];
}
/**
* Implements hook_preprocess_HOOK() for block templates.
*/
function help_preprocess_block(&$variables) {
if ($variables['plugin_id'] == 'help_block') {
$variables['attributes']['role'] = 'complementary';
}
}
/**
* Implements hook_block_view_BASE_BLOCK_ID_alter().
*/
function help_block_view_help_block_alter(array &$build, BlockPluginInterface $block) {
// Assume that most users do not need or want to perform contextual actions on
// the help block, so don't needlessly draw attention to it.
unset($build['#contextual_links']);
}