Skip to content
Snippets Groups Projects
Commit 5c59a95a authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-5747: updating block template to use admin label

parent 9e194c68
No related branches found
No related tags found
No related merge requests found
{# {#
/** /**
* @file * @file
* Theme override to display a block. * Theme override to display a block.
* *
* Available variables: * Available variables:
* - plugin_id: The ID of the block implementation. * - plugin_id: The ID of the block implementation.
* - label: The configured label of the block if visible. * - label: The configured label of the block if visible.
* - configuration: A list of the block's configuration values. * - configuration: A list of the block's configuration values.
* - label: The configured label for the block. * - label: The configured label for the block.
* - label_display: The display settings for the label. * - label_display: The display settings for the label.
* - provider: The module or other provider that provided this block plugin. * - provider: The module or other provider that provided this block plugin.
* - Block plugin specific settings will also be stored here. * - Block plugin specific settings will also be stored here.
* - content: The content of this block. * - 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. * - attributes: array of HTML attributes populated by modules, intended to
* - id: A valid HTML ID and guaranteed unique. * be added to the main container tag of this template.
* - title_attributes: Same as attributes, except applied to the main title tag that appears in the template. * - id: A valid HTML ID and guaranteed unique.
* - title_prefix: Additional output populated by modules, intended to be displayed in front of the main title tag that appears in the template. * - title_attributes: Same as attributes, except applied to the main title
* - title_suffix: Additional output populated by modules, intended to be displayed after the main title tag that appears in the template. * tag that appears in the template.
* * - title_prefix: Additional output populated by modules, intended to be
* @see template_preprocess_block() * 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()
*/
#} #}
{%
set classes = [
'block',
'block-' ~ configuration.provider|clean_class,
'block-' ~ plugin_id|clean_class,
]
%}
{% set classes = [ {% if in_layout_builder %}
'l-block--provider-' ~ configuration.provider|clean_class, {{ attach_library('uw_theme_admin/uw_layout_builder') }}
'l-block--id-' ~ plugin_id|clean_class, {% endif %}
] %}
{% set attributes = attributes.addClass(classes) %} {% if content %}
<div{{ attributes.addClass(classes) }}>
{% embed '@layouts/block/block.twig' with { {% if admin_label %}
'attributes': attributes, <div class="uw-admin-label">{{ admin_label }}</div>
'block_wrapper': true, {% endif %}
'constrain': '', {{ title_prefix }}
'title_prefix': title_prefix, {% if label %}
'title_suffix': title_suffix, <h2{{ title_attributes }}>{{ label }}</h2>
'label': label is not empty ? label : false, {% endif %}
'content_wrapper': true {{ title_suffix }}
} %} {% block content %}
{{ content }}
{% block content %} {% endblock %}
{{ content }} </div>
{% endblock %} {% endif %}
{% endembed %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment