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

templates/ds/rocketship-layout-3col.html.twig
{#
/**
 * @file
 * Template for a rocketship 3 column layout.
 *
 * Available variables:
 * - top: top region
 * - header: header region
 * - primary: sidebar region
 * - secondary: sidebar region
 * - main: main content region
 * - footer: footer region
 * - bottom: bottom region
 */
#}

{% set layoutModifier = 'sidebars' %}
{% set classMain = 'center' %}
{% set classAsideLeft = 'left' %}
{% set classAsideRight = 'right' %}

{# classes for the template wrapper #}

{% set stickyClass =  false %}
{% set promotedClass =  false %}

{% 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--2col',
    'layout--' ~ layoutModifier,

    '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 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 %}

    <div class="layout__cols layout__cols--main layout__cols--{{layoutModifier}}--{{classAsideLeft}} {{'layout__' ~ 'cols' ~ '--' ~ entityType ~ '--' ~ bundle ~ '--' ~ viewMode }}">

      <aside class="layout__region layout__sidebar layout__sidebar--{{layoutModifier}}--{{classAsideLeft}} {{'layout__' ~ 'sidebar' ~ '--' ~ entityType ~ '--' ~ bundle ~ '--' ~ viewMode  ~ '--' ~ classAsideLeft }}">
        {% if content.first is not empty and content.first|render|striptags|length %}
          {{ content.first }}
        {% endif %}
      </aside>

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

      <aside class="layout__region layout__sidebar layout__sidebar--{{layoutModifier}}--{{classAsideRight}} {{'layout__' ~ 'sidebar' ~ '--' ~ entityType ~ '--' ~ bundle ~ '--' ~ viewMode  ~ '--' ~ classAsideRight }}">
        {% if content.second is not empty and content.second|render|striptags|length %}
          {{ content.second }}
        {% endif %}
      </aside>

    </div>

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

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

</div>

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

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