diff --git a/core/lib/Drupal/Core/Layout/Annotation/Layout.php b/core/lib/Drupal/Core/Layout/Annotation/Layout.php index 1cb5ff0a542c9b8a20ea91f0e0bae80650a31100..d2072c249a8a8458a002e378b4d419e2473e03aa 100644 --- a/core/lib/Drupal/Core/Layout/Annotation/Layout.php +++ b/core/lib/Drupal/Core/Layout/Annotation/Layout.php @@ -14,11 +14,6 @@ * * Plugin namespace: Plugin\Layout * - * @internal - * The layout system is currently experimental and should only be leveraged by - * experimental modules and development releases of contributed modules. - * See https://www.drupal.org/core/experimental for more information. - * * @see \Drupal\Core\Layout\LayoutInterface * @see \Drupal\Core\Layout\LayoutDefault * @see \Drupal\Core\Layout\LayoutPluginManager diff --git a/core/lib/Drupal/Core/Layout/LayoutDefault.php b/core/lib/Drupal/Core/Layout/LayoutDefault.php index 22edb856e1d37248acaf1a424913f6028c96770d..6e53d00f444b50335211fcad7371c3baf213df93 100644 --- a/core/lib/Drupal/Core/Layout/LayoutDefault.php +++ b/core/lib/Drupal/Core/Layout/LayoutDefault.php @@ -7,11 +7,6 @@ /** * Provides a default class for Layout plugins. - * - * @internal - * The layout system is currently experimental and should only be leveraged by - * experimental modules and development releases of contributed modules. - * See https://www.drupal.org/core/experimental for more information. */ class LayoutDefault extends PluginBase implements LayoutInterface { diff --git a/core/lib/Drupal/Core/Layout/LayoutDefinition.php b/core/lib/Drupal/Core/Layout/LayoutDefinition.php index afbce7e1c5e7e1a4e0eee7bc963c51fbf13979e8..686cf815383338c772e2954219acc58fa71a90b2 100644 --- a/core/lib/Drupal/Core/Layout/LayoutDefinition.php +++ b/core/lib/Drupal/Core/Layout/LayoutDefinition.php @@ -10,11 +10,6 @@ /** * Provides an implementation of a layout definition and its metadata. - * - * @internal - * The layout system is currently experimental and should only be leveraged by - * experimental modules and development releases of contributed modules. - * See https://www.drupal.org/core/experimental for more information. */ class LayoutDefinition extends PluginDefinition implements PluginDefinitionInterface, DerivablePluginDefinitionInterface, DependentPluginDefinitionInterface { diff --git a/core/lib/Drupal/Core/Layout/LayoutInterface.php b/core/lib/Drupal/Core/Layout/LayoutInterface.php index bb60df005db26bd073e20869357e7e7dc7784a5e..32ee74d18b0472b935f8b75e1242446a701e53e0 100644 --- a/core/lib/Drupal/Core/Layout/LayoutInterface.php +++ b/core/lib/Drupal/Core/Layout/LayoutInterface.php @@ -8,11 +8,6 @@ /** * Provides an interface for static Layout plugins. - * - * @internal - * The layout system is currently experimental and should only be leveraged by - * experimental modules and development releases of contributed modules. - * See https://www.drupal.org/core/experimental for more information. */ interface LayoutInterface extends PluginInspectionInterface, DerivativeInspectionInterface, ConfigurablePluginInterface { diff --git a/core/lib/Drupal/Core/Layout/LayoutPluginManager.php b/core/lib/Drupal/Core/Layout/LayoutPluginManager.php index 0a2878572a465a47668736ce5cff8e3d57c7f6d8..179d1ede9ab7392aaaae32c3d08a7875131d3f4b 100644 --- a/core/lib/Drupal/Core/Layout/LayoutPluginManager.php +++ b/core/lib/Drupal/Core/Layout/LayoutPluginManager.php @@ -15,11 +15,6 @@ /** * Provides a plugin manager for layouts. - * - * @internal - * The layout system is currently experimental and should only be leveraged by - * experimental modules and development releases of contributed modules. - * See https://www.drupal.org/core/experimental for more information. */ class LayoutPluginManager extends DefaultPluginManager implements LayoutPluginManagerInterface { diff --git a/core/lib/Drupal/Core/Layout/LayoutPluginManagerInterface.php b/core/lib/Drupal/Core/Layout/LayoutPluginManagerInterface.php index df15be03ad5ebd64df2e1ecf8f69bd03ae286ee3..c0e606d41fffe6df5744d7068e773a62480f24be 100644 --- a/core/lib/Drupal/Core/Layout/LayoutPluginManagerInterface.php +++ b/core/lib/Drupal/Core/Layout/LayoutPluginManagerInterface.php @@ -6,11 +6,6 @@ /** * Provides the interface for a plugin manager of layouts. - * - * @internal - * The layout system is currently experimental and should only be leveraged by - * experimental modules and development releases of contributed modules. - * See https://www.drupal.org/core/experimental for more information. */ interface LayoutPluginManagerInterface extends CategorizingPluginManagerInterface { diff --git a/core/modules/layout_discovery/layout_discovery.info.yml b/core/modules/layout_discovery/layout_discovery.info.yml index a9a4139ba641ac17d56a5e68f36e600cb7bf240c..d0c8d3aff623920328c9db7064c5ffc5ad1a747b 100644 --- a/core/modules/layout_discovery/layout_discovery.info.yml +++ b/core/modules/layout_discovery/layout_discovery.info.yml @@ -1,6 +1,6 @@ name: 'Layout Discovery' type: module description: 'Provides a way for modules or themes to register layouts.' -package: Core (Experimental) +package: Core version: VERSION core: 8.x diff --git a/core/modules/layout_discovery/layout_discovery.module b/core/modules/layout_discovery/layout_discovery.module index 30e2f128d5f69fb1b12e76c533a3f0f860df4f57..3eed9fe2f994443b499e6c10860882d52a129ec3 100644 --- a/core/modules/layout_discovery/layout_discovery.module +++ b/core/modules/layout_discovery/layout_discovery.module @@ -16,7 +16,7 @@ function layout_discovery_help($route_name) { case 'help.page.layout_discovery': $output = '<h3>' . t('About') . '</h3>'; $output .= '<p>' . t('Layout Discovery allows modules or themes to register layouts, and for other modules to list the available layouts and render them.') . '</p>'; - $output .= '<p>' . t('For more information, see the <a href=":layout-discovery-documentation">online documentation for the Layout Discovery module</a>.', [':layout-discovery-documentation' => 'https://www.drupal.org/node/2619128']) . '</p>'; + $output .= '<p>' . t('For more information, see the <a href=":layout-discovery-documentation">online documentation for the Layout Discovery module</a>.', [':layout-discovery-documentation' => 'https://www.drupal.org/docs/8/api/layout-api']) . '</p>'; return $output; } } diff --git a/core/modules/layout_discovery/layouts/twocol_bricks/layout--twocol-bricks.html.twig b/core/modules/layout_discovery/layouts/twocol_bricks/layout--twocol-bricks.html.twig index 805826cbaa7d926a814c2551dc1d659395820ce5..dc29e03e43027aa3062aedab88e6aa813a142212 100644 --- a/core/modules/layout_discovery/layouts/twocol_bricks/layout--twocol-bricks.html.twig +++ b/core/modules/layout_discovery/layouts/twocol_bricks/layout--twocol-bricks.html.twig @@ -58,7 +58,7 @@ {% endif %} {% if content.bottom %} - <div {{ content.bottom.addClass('layout__region', 'layout__region--bottom') }}> + <div {{ region_attributes.bottom.addClass('layout__region', 'layout__region--bottom') }}> {{ content.bottom }} </div> {% endif %} diff --git a/core/themes/stable/templates/layout/layout--onecol.html.twig b/core/themes/stable/templates/layout/layout--onecol.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..3a7f9934d09971ffb0d812caea966ad8977241de --- /dev/null +++ b/core/themes/stable/templates/layout/layout--onecol.html.twig @@ -0,0 +1,25 @@ +{# +/** + * @file + * Default theme implementation to display a one-column layout. + * + * Available variables: + * - content: The content for this layout. + * - attributes: HTML attributes for the layout <div>. + * + * @ingroup themeable + */ +#} +{% + set classes = [ + 'layout', + 'layout--onecol', + ] +%} +{% if content %} + <div{{ attributes.addClass(classes) }}> + <div {{ region_attributes.content.addClass('layout__region', 'layout__region--content') }}> + {{ content.content }} + </div> + </div> +{% endif %} diff --git a/core/themes/stable/templates/layout/layout--threecol-25-50-25.html.twig b/core/themes/stable/templates/layout/layout--threecol-25-50-25.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..e5441d8b6be991c7e65700e2870aeaf2ef7ccb4d --- /dev/null +++ b/core/themes/stable/templates/layout/layout--threecol-25-50-25.html.twig @@ -0,0 +1,54 @@ +{# +/** + * @file + * Default theme implementation for a three column layout. + * + * This template provides a three column 25%-50%-25% display layout, with + * additional areas for the top and the bottom. + * + * Available variables: + * - content: The content for this layout. + * - attributes: HTML attributes for the layout <div>. + * + * @ingroup themeable + */ +#} +{% + set classes = [ + 'layout', + 'layout--threecol-25-50-25', + ] +%} +{% if content %} + <div{{ attributes.addClass(classes) }}> + {% if content.top %} + <div {{ region_attributes.top.addClass('layout__region', 'layout__region--top') }}> + {{ content.top }} + </div> + {% endif %} + + {% if content.first %} + <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}> + {{ content.first }} + </div> + {% endif %} + + {% if content.second %} + <div {{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}> + {{ content.second }} + </div> + {% endif %} + + {% if content.third %} + <div {{ region_attributes.third.addClass('layout__region', 'layout__region--third') }}> + {{ content.third }} + </div> + {% endif %} + + {% if content.bottom %} + <div {{ region_attributes.bottom.addClass('layout__region', 'layout__region--bottom') }}> + {{ content.bottom }} + </div> + {% endif %} + </div> +{% endif %} diff --git a/core/themes/stable/templates/layout/layout--threecol-33-34-33.html.twig b/core/themes/stable/templates/layout/layout--threecol-33-34-33.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..6445061c04e4b9ea4f5a53f2c01b818692742930 --- /dev/null +++ b/core/themes/stable/templates/layout/layout--threecol-33-34-33.html.twig @@ -0,0 +1,54 @@ +{# +/** + * @file + * Default theme implementation for a three column layout. + * + * This template provides a three column 33%-34%-33% display layout, with + * additional areas for the top and the bottom. + * + * Available variables: + * - content: The content for this layout. + * - attributes: HTML attributes for the layout <div>. + * + * @ingroup themeable + */ +#} +{% + set classes = [ + 'layout', + 'layout--threecol-33-34-33', + ] +%} +{% if content %} + <div{{ attributes.addClass(classes) }}> + {% if content.top %} + <div {{ region_attributes.top.addClass('layout__region', 'layout__region--top') }}> + {{ content.top }} + </div> + {% endif %} + + {% if content.first %} + <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}> + {{ content.first }} + </div> + {% endif %} + + {% if content.second %} + <div {{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}> + {{ content.second }} + </div> + {% endif %} + + {% if content.third %} + <div {{ region_attributes.third.addClass('layout__region', 'layout__region--third') }}> + {{ content.third }} + </div> + {% endif %} + + {% if content.bottom %} + <div {{ region_attributes.bottom.addClass('layout__region', 'layout__region--bottom') }}> + {{ content.bottom }} + </div> + {% endif %} + </div> +{% endif %} diff --git a/core/themes/stable/templates/layout/layout--twocol-bricks.html.twig b/core/themes/stable/templates/layout/layout--twocol-bricks.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..dc29e03e43027aa3062aedab88e6aa813a142212 --- /dev/null +++ b/core/themes/stable/templates/layout/layout--twocol-bricks.html.twig @@ -0,0 +1,66 @@ +{# +/** + * @file + * Default theme implementation for a two column layout. + * + * This template provides a two column display layout with full width areas at + * the top, bottom and in the middle. + * + * Available variables: + * - content: The content for this layout. + * - attributes: HTML attributes for the layout <div>. + * + * @ingroup themeable + */ +#} +{% + set classes = [ + 'layout', + 'layout--twocol-bricks', + ] +%} +{% if content %} + <div{{ attributes.addClass(classes) }}> + {% if content.top %} + <div {{ region_attributes.top.addClass('layout__region', 'layout__region--top') }}> + {{ content.top }} + </div> + {% endif %} + + {% if content.first_above %} + <div {{ region_attributes.first_above.addClass('layout__region', 'layout__region--first-above') }}> + {{ content.first_above }} + </div> + {% endif %} + + {% if content.second_above %} + <div {{ region_attributes.second_above.addClass('layout__region', 'layout__region--second-above') }}> + {{ content.second_above }} + </div> + {% endif %} + + {% if content.middle %} + <div {{ region_attributes.middle.addClass('layout__region', 'layout__region--middle') }}> + {{ content.middle }} + </div> + {% endif %} + + {% if content.first_below %} + <div {{ region_attributes.first_below.addClass('layout__region', 'layout__region--first-below') }}> + {{ content.first_below }} + </div> + {% endif %} + + {% if content.second_below %} + <div {{ region_attributes.second_below.addClass('layout__region', 'layout__region--second-below') }}> + {{ content.second_below }} + </div> + {% endif %} + + {% if content.bottom %} + <div {{ region_attributes.bottom.addClass('layout__region', 'layout__region--bottom') }}> + {{ content.bottom }} + </div> + {% endif %} + </div> +{% endif %} diff --git a/core/themes/stable/templates/layout/layout--twocol.html.twig b/core/themes/stable/templates/layout/layout--twocol.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..262c657f919ec0225db6edd97a72c3ce09ce6f69 --- /dev/null +++ b/core/themes/stable/templates/layout/layout--twocol.html.twig @@ -0,0 +1,45 @@ +{# +/** + * @file + * Default theme implementation to display a two-column layout. + * + * Available variables: + * - content: The content for this layout. + * - attributes: HTML attributes for the layout <div>. + * + * @ingroup themeable + */ +#} +{% + set classes = [ + 'layout', + 'layout--twocol', + ] +%} +{% if content %} + <div{{ attributes.addClass(classes) }}> + {% if content.top %} + <div {{ region_attributes.top.addClass('layout__region', 'layout__region--top') }}> + {{ content.top }} + </div> + {% endif %} + + {% if content.first %} + <div {{ region_attributes.first.addClass('layout__region', 'layout__region--first') }}> + {{ content.first }} + </div> + {% endif %} + + {% if content.second %} + <div {{ region_attributes.second.addClass('layout__region', 'layout__region--second') }}> + {{ content.second }} + </div> + {% endif %} + + {% if content.bottom %} + <div {{ region_attributes.bottom.addClass('layout__region', 'layout__region--bottom') }}> + {{ content.bottom }} + </div> + {% endif %} + </div> +{% endif %} diff --git a/core/themes/stable/templates/layout/layout.html.twig b/core/themes/stable/templates/layout/layout.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..59df5c6404153f38b8c2af13ecb6610729d4e634 --- /dev/null +++ b/core/themes/stable/templates/layout/layout.html.twig @@ -0,0 +1,23 @@ +{# +/** + * @file + * Template for a generic layout. + */ +#} +{% + set classes = [ + 'layout', + 'layout--' ~ layout.id|clean_class, + ] +%} +{% if content %} + <div{{ attributes.addClass(classes) }}> + {% for region in layout.getRegionNames %} + {% if content[region] %} + <div {{ region_attributes[region].addClass('layout__region', 'layout__region--' ~ region|clean_class) }}> + {{ content[region] }} + </div> + {% endif %} + {% endfor %} + </div> +{% endif %}