rocketship_core-8.x-2.0-alpha11/templates/ds/rocketship-layout-1col.html.twig

templates/ds/rocketship-layout-1col.html.twig
{#
/**
 * @file
 * Template for a rocketship 1 column layout.
 */
#}

{# classes for the template wrapper #}

{% set stickyClass =  false %}
{% set promotedClass =  false %}
{% set layoutModifier = 'no-sidebars' %}

{% if content['#node'] is defined %}
  {% if content['#node'].get('promote') is defined and content['#node'].get('promote').value == 1 %}
    {% set promotedClass =  true %}
  {% endif %}
  {% if content['#node'].get('sticky') is defined and content['#node'].get('sticky').value == 1 %}
    {% set stickyClass =  true %}
  {% endif %}
{% endif %}

{% set entityType = content['#entity_type']|replace('_', '-') %}
{% set bundle = content['#bundle']|replace('_', '-') %}
{% set viewMode = content['#view_mode']|replace('_', '-') %}

{%
  set classes = [
    'layout',
    'layout--1col',

    'clearfix',

    'entity-type--' ~ content['#entity_type']|replace('_', '-'),
    'bundle--' ~ content['#bundle']|replace('_', '-'),
    'view-mode--' ~ content['#view_mode']|replace('_', '-'),

    stickyClass ? 'is-sticky',
    promotedClass ? 'is-promoted',
    stickyClass ? content['#entity_type']|replace('_', '-') ~ '--type-' ~ content['#bundle']|replace('_', '-') ~ '--sticky',
    promotedClass ? content['#entity_type']|replace('_', '-') ~ '--type-' ~ content['#bundle']|replace('_', '-') ~ '--promoted',

    content['#bundle']|replace('_', '-') ~ '--' ~ content['#view_mode']|replace('_', '-'),

    content['#entity_type']|replace('_', '-'),
    content['#entity_type']|replace('_', '-') ~ '--' ~ 'type-' ~ content['#bundle']|replace('_', '-'),
    content['#entity_type']|replace('_', '-') ~ '--' ~ 'view-mode-' ~ content['#view_mode']|replace('_', '-'),
  ]
%}

<div{{ attributes.addClass(classes|join(' ')) }}>

  {% if title_suffix and title_suffix.contextual_links %}
    {{ title_suffix.contextual_links }}
  {% endif %}

  {% if title_suffix and title_suffix.contextual_links %}
    {{ title_suffix.contextual_links }}
  {% endif %}

  {% if content.top is not empty and content.top|render|striptags|length %}
    <div class="layout__region layout__top {{'layout__' ~ 'top' ~ '--' ~ entityType ~ '--' ~ bundle ~ '--' ~ viewMode }}">
      {{ content.top }}
    </div>
  {% endif %}

  {% if content.header is not empty and content.header|render|striptags|length %}
    <header class="layout__region layout__header {{'layout__' ~ 'header' ~ '--' ~ entityType ~ '--' ~ bundle ~ '--' ~ viewMode }}">
      {{ content.header }}
    </header>
  {% endif %}

  {% if content.content is not empty and content.content|render|striptags|length %}
    <div class="layout__region layout__content {{'layout__' ~ 'content' ~ '--' ~ entityType ~ '--' ~ bundle ~ '--' ~ viewMode }}">
      {{ content.content }}
    </div>
  {% endif %}

  {% if content.footer is not empty and content.footer|render|striptags|length %}
    <footer class="layout__region layout__footer {{content['#bundle']}}__layout__footer--{{content['#view_mode']}}">
      {{ content.footer }}
    </footer>
  {% endif %}

  {% if content.bottom is not empty and content.bottom|render|striptags|length %}
    <div class="layout__region layout__bottom {{content['#bundle']}}__layout__bottom--{{content['#view_mode']}}">
      {{ content.bottom }}
    </div>
  {% endif %}
</div>

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

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