diff --git a/core/modules/help/help.module b/core/modules/help/help.module
index 6d07405..72e73a7 100644
--- a/core/modules/help/help.module
+++ b/core/modules/help/help.module
@@ -45,19 +45,13 @@ function help_menu_link_defaults() {
function help_help($path, $arg) {
switch ($path) {
case 'admin/help':
- $output = '
' . 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.', array('!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.', array('!modules' => \Drupal::url('system.modules_list'), '!download_modules' => 'https://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.', array('!themes' => \Drupal::url('system.themes_page'), '!download_themes' => 'https://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.', array('!content' => \Drupal::url('node.add_page'))) . '
';
- }
- $output .= '
';
- $output .= '' . t('For more information, refer to the subjects listed in the Help Topics section or to the online documentation and support pages at drupal.org.', array('!docs' => 'https://drupal.org/documentation', '!support' => 'https://drupal.org/support', '!drupal' => 'https://drupal.org')) . '
';
- return $output;
+ return array(
+ 'template' => 'overview.html.twig',
+ 'variables' => array(
+ 'node' => \Drupal::moduleHandler()->moduleExists('node'),
+ 'node_add_url' => \Drupal::url('node.add_page'),
+ ),
+ );
case 'admin/help#help':
$output = '';
$output .= '' . t('About') . '
';
diff --git a/core/modules/help/help/overview.html.twig b/core/modules/help/help/overview.html.twig
new file mode 100644
index 0000000..6a43dc9
--- /dev/null
+++ b/core/modules/help/help/overview.html.twig
@@ -0,0 +1,22 @@
+{#
+/**
+ * @file
+ * Overview of help module displayed at admin/help.
+ *
+ * Available variables:
+ * - node: TRUE if the node module is enabled.
+ * - node_add_url: Url to node/add.
+#}
+{{ 'Getting Started.'|t }}
+{{ 'Follow these steps to set up and start using your website:'|t }}
+
+ - {{ 'Configure your website Once logged in, visit the Administration page, where you may customize and configure all aspects of your website.'|t({'!admin': url('admin'), '!config': url('admin/config')}) }}
+ - {{ '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.'|t({'!modules': url('admin/modules'), '!download_modules': 'https://drupal.org/project/modules'}) }}
+ - {{ '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.'|t({'!themes': url('admin/appearance'), '!download_themes': 'https://drupal.org/project/themes'}) }}
+ {# // Display a link to the create content page if Node module is enabled. #}
+ {% if node %}
+ - {{ 'Start posting content Finally, you may add new content to your website.'|t({'!content': url('node/add')}) }}
+ {% endif %}
+
+ {{ 'For more information, refer to the subjects listed in the Help Topics section or to the online documentation and support pages at drupal.org'|t({'!docs': 'https://drupal.org/documentation', '!support': 'https://drupal.org/support', '!drupal': 'https://drupal.org'}) }}
+
diff --git a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php
index f669e61..4e7bd88 100644
--- a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php
+++ b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php
@@ -11,6 +11,7 @@
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Session\AccountInterface;
+use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
@@ -100,10 +101,20 @@ protected function getActiveHelp(Request $request) {
foreach ($this->moduleHandler->getImplementations('help') as $module) {
$function = $module . '_help';
- // Lookup help for this path.
if ($help = $function($router_path, $arg)) {
- $output .= $help . "\n";
+ // If $help is an array with a 'template' key, this uses a twig file.
+ if (is_array($help) && !empty($help['template']) &&
+ ($template = drupal_get_path('module', $module) . '/help/' . $help['template']) &&
+ file_exists($template)) {
+ $output .= twig_render_template($template, empty($help['variables']) ? array() : $help['variables']);
+ }
+ else {
+ $output .= $help . "\n";
+ }
}
+
+ // Lookup help for this path.
+
}
return $output;
}