From 3bb191739b28190a6e4765bf0c8e9cce691c5f38 Mon Sep 17 00:00:00 2001 From: just_like_good_vibes <mickael@meulle.com> Date: Fri, 7 Feb 2025 09:10:57 +0100 Subject: [PATCH] fixed --- .../system/block--system-menu-block.html.twig | 45 +++++++++++++++++++ templates/overrides/system/block.html.twig | 4 +- .../ui-patterns-stories-compact.html.twig | 16 +++++++ 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 templates/overrides/system/block--system-menu-block.html.twig create mode 100644 templates/ui_patterns_library/ui-patterns-stories-compact.html.twig diff --git a/templates/overrides/system/block--system-menu-block.html.twig b/templates/overrides/system/block--system-menu-block.html.twig new file mode 100644 index 00000000..11cf5bdd --- /dev/null +++ b/templates/overrides/system/block--system-menu-block.html.twig @@ -0,0 +1,45 @@ +{# +/** + * @file + * Default theme implementation to display a block. + * + * Available variables: + * - plugin_id: The ID of the block implementation. + * - label: The configured label of the block if visible. + * - configuration: A list of the block's configuration values. + * - label: The configured label for the block. + * - label_display: The display settings for the label. + * - provider: The module or other provider that provided this block plugin. + * - Block plugin specific settings will also be stored here. + * - content: The content of this block. + * - attributes: array of HTML attributes populated by modules, intended to + * be added to the main container tag of this template. + * - id: A valid HTML ID and guaranteed unique. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * + * @see template_preprocess_block() + * + * @ingroup themeable + */ +#} +{% if attributes.storage() %} +<div{{ attributes }}> +{% endif %} + +{{ title_prefix }} +{% if label %} + <h2{{ title_attributes }}>{{ label }}</h2> +{% endif %} +{{ title_suffix }} +{% block content %} + {{ content }} +{% endblock %} + +{% if attributes.storage() %} +</div> +{% endif %} diff --git a/templates/overrides/system/block.html.twig b/templates/overrides/system/block.html.twig index e4950c76..11cf5bdd 100644 --- a/templates/overrides/system/block.html.twig +++ b/templates/overrides/system/block.html.twig @@ -27,7 +27,7 @@ * @ingroup themeable */ #} -{% if attributes is not empty %} +{% if attributes.storage() %} <div{{ attributes }}> {% endif %} @@ -40,6 +40,6 @@ {{ content }} {% endblock %} -{% if attributes is not empty %} +{% if attributes.storage() %} </div> {% endif %} diff --git a/templates/ui_patterns_library/ui-patterns-stories-compact.html.twig b/templates/ui_patterns_library/ui-patterns-stories-compact.html.twig new file mode 100644 index 00000000..9881e4e2 --- /dev/null +++ b/templates/ui_patterns_library/ui-patterns-stories-compact.html.twig @@ -0,0 +1,16 @@ +<div class="ui_patterns_component__stories"> + {% for story_id, story in component.stories %} + {{ _self.render_story(component.id, story_id, story, component.variants) }} + {% endfor %} +</div> +{% macro render_story(component_id, story_id, story, variants) %} + <div class="ui_patterns_story"> + {% if variants and not story.props.variant %} + {% for variant_id, variant in variants %} + {{ component_story(component_id, story_id, {}, {variant: variant_id}) }} + {% endfor %} + {% else %} + {{ component_story(component_id, story_id) }} + {% endif %} + </div> +{% endmacro %} -- GitLab