comparison core/modules/block/block.module @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
16 * Implements hook_help(). 16 * Implements hook_help().
17 */ 17 */
18 function block_help($route_name, RouteMatchInterface $route_match) { 18 function block_help($route_name, RouteMatchInterface $route_match) {
19 switch ($route_name) { 19 switch ($route_name) {
20 case 'help.page.block': 20 case 'help.page.block':
21 $block_content = \Drupal::moduleHandler()->moduleExists('block_content') ? \Drupal::url('help.page', ['name' => 'block_content']) : '#'; 21 $block_content = \Drupal::moduleHandler()->moduleExists('block_content') ? Url::fromRoute('help.page', ['name' => 'block_content'])->toString() : '#';
22 $output = ''; 22 $output = '';
23 $output .= '<h3>' . t('About') . '</h3>'; 23 $output .= '<h3>' . t('About') . '</h3>';
24 $output .= '<p>' . t('The Block module allows you to place blocks in regions of your installed themes, and configure block settings. For more information, see the <a href=":blocks-documentation">online documentation for the Block module</a>.', [':blocks-documentation' => 'https://www.drupal.org/documentation/modules/block/']) . '</p>'; 24 $output .= '<p>' . t('The Block module allows you to place blocks in regions of your installed themes, and configure block settings. For more information, see the <a href=":blocks-documentation">online documentation for the Block module</a>.', [':blocks-documentation' => 'https://www.drupal.org/documentation/modules/block/']) . '</p>';
25 $output .= '<h3>' . t('Uses') . '</h3>'; 25 $output .= '<h3>' . t('Uses') . '</h3>';
26 $output .= '<dl>'; 26 $output .= '<dl>';
27 $output .= '<dt>' . t('Placing and moving blocks') . '</dt>'; 27 $output .= '<dt>' . t('Placing and moving blocks') . '</dt>';
28 $output .= '<dd>' . t('You can place a new block in a region by selecting <em>Place block</em> on the <a href=":blocks">Block layout page</a>. Once a block is placed, it can be moved to a different region by drag-and-drop or by using the <em>Region</em> drop-down list, and then clicking <em>Save blocks</em>.', [':blocks' => \Drupal::url('block.admin_display')]) . '</dd>'; 28 $output .= '<dd>' . t('You can place a new block in a region by selecting <em>Place block</em> on the <a href=":blocks">Block layout page</a>. Once a block is placed, it can be moved to a different region by drag-and-drop or by using the <em>Region</em> drop-down list, and then clicking <em>Save blocks</em>.', [':blocks' => Url::fromRoute('block.admin_display')->toString()]) . '</dd>';
29 $output .= '<dt>' . t('Toggling between different themes') . '</dt>'; 29 $output .= '<dt>' . t('Toggling between different themes') . '</dt>';
30 $output .= '<dd>' . t('Blocks are placed and configured specifically for each theme. The Block layout page opens with the default theme, but you can toggle to other installed themes.') . '</dd>'; 30 $output .= '<dd>' . t('Blocks are placed and configured specifically for each theme. The Block layout page opens with the default theme, but you can toggle to other installed themes.') . '</dd>';
31 $output .= '<dt>' . t('Demonstrating block regions for a theme') . '</dt>'; 31 $output .= '<dt>' . t('Demonstrating block regions for a theme') . '</dt>';
32 $output .= '<dd>' . t('You can see where the regions are for the current theme by clicking the <em>Demonstrate block regions</em> link on the <a href=":blocks">Block layout page</a>. Regions are specific to each theme.', [':blocks' => \Drupal::url('block.admin_display')]) . '</dd>'; 32 $output .= '<dd>' . t('You can see where the regions are for the current theme by clicking the <em>Demonstrate block regions</em> link on the <a href=":blocks">Block layout page</a>. Regions are specific to each theme.', [':blocks' => Url::fromRoute('block.admin_display')->toString()]) . '</dd>';
33 $output .= '<dt>' . t('Configuring block settings') . '</dt>'; 33 $output .= '<dt>' . t('Configuring block settings') . '</dt>';
34 $output .= '<dd>' . t('To change the settings of an individual block click on the <em>Configure</em> link on the <a href=":blocks">Block layout page</a>. The available options vary depending on the module that provides the block. For all blocks you can change the block title and toggle whether to display it.', [':blocks' => Drupal::url('block.admin_display')]) . '</dd>'; 34 $output .= '<dd>' . t('To change the settings of an individual block click on the <em>Configure</em> link on the <a href=":blocks">Block layout page</a>. The available options vary depending on the module that provides the block. For all blocks you can change the block title and toggle whether to display it.', [':blocks' => Url::fromRoute('block.admin_display')->toString()]) . '</dd>';
35 $output .= '<dt>' . t('Controlling visibility') . '</dt>'; 35 $output .= '<dt>' . t('Controlling visibility') . '</dt>';
36 $output .= '<dd>' . t('You can control the visibility of a block by restricting it to specific pages, content types, and/or roles by setting the appropriate options under <em>Visibility settings</em> of the block configuration.') . '</dd>'; 36 $output .= '<dd>' . t('You can control the visibility of a block by restricting it to specific pages, content types, and/or roles by setting the appropriate options under <em>Visibility settings</em> of the block configuration.') . '</dd>';
37 $output .= '<dt>' . t('Adding custom blocks') . '</dt>'; 37 $output .= '<dt>' . t('Adding custom blocks') . '</dt>';
38 $output .= '<dd>' . t('You can add custom blocks, if the <em>Custom Block</em> module is installed. For more information, see the <a href=":blockcontent-help">Custom Block help page</a>.', [':blockcontent-help' => $block_content]) . '</dd>'; 38 $output .= '<dd>' . t('You can add custom blocks, if the <em>Custom Block</em> module is installed. For more information, see the <a href=":blockcontent-help">Custom Block help page</a>.', [':blockcontent-help' => $block_content]) . '</dd>';
39 $output .= '</dl>'; 39 $output .= '</dl>';