adaptivetheme-8.x-3.x-dev/at_core/templates/block/block.html.twig

at_core/templates/block/block.html.twig
{#
/**
 * @file
 * Theme override 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.
 * - bundle: The bundle of a custom block.
 * - view_mode: The view mode a custom block was rendered in.
 *
 * @see template_preprocess_block()
 */
#}
{%-
  set classes = [
    'block',
    'block-config-provider--' ~ configuration.provider|clean_class,
    'block-plugin-id--' ~ plugin_id_clean|clean_class,
    label ? 'has-title',
    bundle ? 'block--type-' ~ bundle|clean_class,
    view_mode ? 'block--view-mode-' ~ view_mode|clean_class,
  ]
-%}
{%- set heading_id = attributes.id ~ '-title'|clean_id -%}
<div{{ attributes.addClass(classes)|without('role', 'aria-labelledby') }}{%- if label %} role="region" aria-labelledby="{{ heading_id }}"{%- endif -%}>
  <div class="block__inner">

    {{ title_prefix }}
    {%- if label -%}
      <h2 {{ title_attributes.addClass('block__title').setAttribute('id', heading_id) }}><span>{{ label }}</span></h2>
    {%- endif -%}
    {{ title_suffix }}

    {%- block content -%}
      <div{{ content_attributes.addClass('block__content') }}>
        {{- content -}}
      </div>
    {%- endblock -%}

  </div>
</div>

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc