diff --git a/core/modules/settings_tray/settings_tray.api.php b/core/modules/settings_tray/settings_tray.api.php index 05297f0d4b..a3053fd098 100644 --- a/core/modules/settings_tray/settings_tray.api.php +++ b/core/modules/settings_tray/settings_tray.api.php @@ -10,9 +10,31 @@ * @{ * Settings Tray API * + * @section sec_overview Overview and terminology + * + * The Settings Tray module makes administering blocks easier. It provides a + * "Quick Edit" link for blocks using the Contextual Links module. Clicking this + * link opens the off-canvas Settings Tray which allows changing the rendered + * contents of the block by showing all relevant configuration (minus block + * visibility conditions). This means blocks can be modified without leaving the + * page. + * + * For example: + * - For every block, one can configure whether to display the block title or + * not, and optionally override it (block configuration). + * - For menu blocks, one can configure which menu levels to display (block + * configuration) but also the menu itself (menu configuration). + * - For the site branding block, one can change which branding elements to + * display (block configuration), but also the site name and slogan (simple + * configuration). + * * @section sec_api The API: the form in the Settings Tray * - * By default, every block will show its built-in form in the Settings Tray. + * By default, every block will show its built-in form in the Settings Tray + * which uses the off-canvas dialog. + * + * @see core/misc/dialog/off-canvas.es6.js + * * However, many blocks would benefit from a tailored form which either: * - limits the form items displayed in the Settings Tray to only items that * affect the content of the rendered block diff --git a/core/modules/settings_tray/settings_tray.info.yml b/core/modules/settings_tray/settings_tray.info.yml index f25420f3eb..bb2e36c4d9 100644 --- a/core/modules/settings_tray/settings_tray.info.yml +++ b/core/modules/settings_tray/settings_tray.info.yml @@ -1,6 +1,6 @@ name: 'Settings Tray' type: module -description: 'Provides the ability to change the most common configuration from the Drupal front-end.' +description: 'Provides a sidebar to configure blocks on the page.' package: Core (Experimental) version: VERSION core: 8.x diff --git a/core/modules/settings_tray/settings_tray.module b/core/modules/settings_tray/settings_tray.module index af04450459..20a2eac2d9 100644 --- a/core/modules/settings_tray/settings_tray.module +++ b/core/modules/settings_tray/settings_tray.module @@ -7,6 +7,7 @@ use Drupal\Core\Asset\AttachedAssetsInterface; use Drupal\Core\Routing\RouteMatchInterface; +use Drupal\Core\Url; use Drupal\settings_tray\Block\BlockEntityOffCanvasForm; use Drupal\settings_tray\Form\SystemBrandingOffCanvasForm; use Drupal\settings_tray\Form\SystemMenuOffCanvasForm; @@ -18,10 +19,15 @@ function settings_tray_help($route_name, RouteMatchInterface $route_match) { switch ($route_name) { case 'help.page.settings_tray': $output = '

' . t('About') . '

'; - $output .= '

' . t('The Settings Tray module provides an \'edit mode\' in which clicking on a block opens a slide-out tray which allows configuration to be altered without leaving the page.For more information, see the online documentation for the Settings Tray module.', [':settings-tray-documentation' => 'https://www.drupal.org/documentation/modules/settings_tray']) . '

'; + $output .= '

' . t('The Settings Tray module allows users with the Administer blocks and Use contextual links permissions to edit blocks without visiting a separate page. For more information, see the online documentation for the Settings Tray module.', [':handbook_url' => 'https://www.drupal.org/documentation/modules/settings_tray', ':administer_block_permission' => \Drupal::url('user.admin_permissions', [], ['fragment' => 'module-block']), ':contextual_permission' => \Drupal::url('user.admin_permissions', [], ['fragment' => 'module-contextual'])]) . '

'; $output .= '

' . t('Uses') . '

'; $output .= '
'; - $output .= '
' . t('Editing blocks on the same page in the slide-out tray') . '
'; + $output .= '
' . t('Editing blocks in place') . '
'; + $output .= '
'; + $output .= '

' . t('To edit blocks in place, either click the Edit button in the toolbar and then click on the block, or choose "Quick edit" from the block\'s contextual link. (see the Contextual Links module help for more information about how to use contextual links).', [':contextual' => \Drupal::url('help.page', ['name' => 'contextual'])]) . '

'; + $output .= '

' . t('The Settings Tray for the block will open in a sidebar, with a compact form for configuring what the block shows.') . '

'; + $output .= '

' . t('Save the form and the changes will be immediately visible on the page.') . '

'; + $output .= '
'; $output .= '
'; return ['#markup' => $output]; }