Mercurial > hg > isophonics-drupal-site
comparison core/modules/settings_tray/settings_tray.api.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
8 /** | 8 /** |
9 * @defgroup settings_tray Settings Tray API | 9 * @defgroup settings_tray Settings Tray API |
10 * @{ | 10 * @{ |
11 * Settings Tray API | 11 * Settings Tray API |
12 * | 12 * |
13 * @section sec_overview Overview and terminology | |
14 * | |
15 * The Settings Tray module allows blocks to be configured in a sidebar form | |
16 * without leaving the page. For example: | |
17 * | |
18 * - For every block, one can configure whether to display the block title or | |
19 * not, and optionally override it (block configuration). | |
20 * - For menu blocks, one can configure which menu levels to display (block | |
21 * configuration) but also the menu itself (menu configuration). | |
22 * - For the site branding block, one can change which branding elements to | |
23 * display (block configuration), but also the site name and slogan (simple | |
24 * configuration). | |
25 * | |
26 * Block visibility conditions are not included the sidebar form. | |
27 * | |
13 * @section sec_api The API: the form in the Settings Tray | 28 * @section sec_api The API: the form in the Settings Tray |
14 * | 29 * |
15 * By default, every block will show its built-in form in the Settings Tray. | 30 * By default, the Settings Tray shows any block's built-in form in the |
31 * off-canvas dialog. | |
32 * | |
33 * @see core/misc/dialog/off-canvas.es6.js | |
34 * | |
16 * However, many blocks would benefit from a tailored form which either: | 35 * However, many blocks would benefit from a tailored form which either: |
17 * - limits the form items displayed in the Settings Tray to only items that | 36 * - limits the form items displayed in the Settings Tray to only items that |
18 * affect the content of the rendered block | 37 * affect the content of the rendered block |
19 * - adds additional form items to edit configuration that is rendered by the | 38 * - adds additional form items to edit configuration that is rendered by the |
20 * block. See \Drupal\settings_tray\Form\SystemBrandingOffCanvasForm which | 39 * block. See \Drupal\settings_tray\Form\SystemBrandingOffCanvasForm which |
30 * "settings_tray" = "\Drupal\some_module\Form\MyBlockOffCanvasForm", | 49 * "settings_tray" = "\Drupal\some_module\Form\MyBlockOffCanvasForm", |
31 * }, | 50 * }, |
32 * @endcode | 51 * @endcode |
33 * | 52 * |
34 * In some cases, a block's content is not configurable (for example, the title, | 53 * In some cases, a block's content is not configurable (for example, the title, |
35 * main content, and help blocks). Such blocks can opt out of providing an | 54 * main content, and help blocks). Such blocks can opt out of providing a |
36 * off-canvas form: | 55 * settings_tray form: |
37 * @code | 56 * @code |
38 * forms = { | 57 * forms = { |
39 * "settings_tray" = FALSE, | 58 * "settings_tray" = FALSE, |
40 * }, | 59 * }, |
41 * @endcode | 60 * @endcode |
42 * | 61 * |
43 * Finally, blocks that do not specify an off-canvas form using the annotation | 62 * Finally, blocks that do not specify a settings_tray form using the annotation |
44 * above will automatically have it set to their plugin class. For example, the | 63 * above will automatically have it set to their plugin class. For example, the |
45 * "Powered by Drupal" block plugin | 64 * "Powered by Drupal" block plugin |
46 * (\Drupal\system\Plugin\Block\SystemPoweredByBlock) automatically gets | 65 * (\Drupal\system\Plugin\Block\SystemPoweredByBlock) automatically gets this |
47 * this added to its annotation: | 66 * added to its annotation: |
48 * @code | 67 * @code |
49 * forms = { | 68 * forms = { |
50 * "settings_tray" = "\Drupal\system\Plugin\Block\SystemPoweredByBlock", | 69 * "settings_tray" = "\Drupal\system\Plugin\Block\SystemPoweredByBlock", |
51 * }, | 70 * }, |
52 * @endcode | 71 * @endcode |