' . t('About') . ''; $output .= '

' . t('Layout Plugin allows modules or themes to register layouts, and for other modules to list the available layouts and render them. For more information, see the online documentation for the Layout Plugin module.', [':layout-plugin-documentation' => 'https://www.drupal.org/node/2619128']) . '

'; $output .= '

' . t('Uses') . '

'; $output .= '

' . t('This is an API module which serves as the plugin manager for layouts. API modules provide a common set of routines, protocols, and tools developers use for building specific features into modules for your site. See the Layout Plugin project page for a complete listing of Modules that use Layout Plugin.', [':layout_plugin' => 'https://www.drupal.org/project/layout_plugin']) . '

'; $output .= '

' . t('Registering a Layout Plugin - There are several ways to register your layout. For more information of the simplest, most common case and then building up to some of the more advanced techniques, see How to register layouts with Layout Plugin.', [':layout_plugin' => 'https://www.drupal.org/node/2578731']) . '

'; $output .= '

' . t('Rendering a Layout Plugin - To render a layout plugin you first get the layout plugin manager, then list available layouts and instantiate the layout plugin. Rendering is then possible and a configuration display for showing and storing layouts is made available. For more information on rendering layouts, see How to render layouts using Layout Plugin.', [':layout_plugin' => 'https://www.drupal.org/node/2619168']) . '

'; return $output; } } /** * Implements hook_theme(). */ function layout_plugin_theme() { return Layout::layoutPluginManager()->getThemeImplementations(); } /** * Implements hook_theme_registry_alter(). */ function layout_plugin_theme_registry_alter(&$theme_registry) { Layout::layoutPluginManager()->alterThemeImplementations($theme_registry); } /** * Implements hook_library_info_build(). */ function layout_plugin_library_info_build() { return Layout::layoutPluginManager()->getLibraryInfo(); } /** * Prepares variables for layout templates. * * We name it with an underscore so if there is ever a template called 'layout' * that this preprocess function doesn't automatically get picked up. * * @param array &$variables * An associative array containing: * - element: An associative array containing the properties of the element. * Properties used: #settings, #layout */ function _layout_plugin_preprocess_layout(&$variables) { $content = $variables['content']; $variables['settings'] = $content['#settings'] ?: []; $variables['layout'] = $content['#layout'] ?: []; }