bootstrap_italia-8.x-0.x-dev/components/components-0x/hero/hero.twig

components/components-0x/hero/hero.twig
{#
/**
 * @file
 * Template for hero component.
 * Docs: https://italia.github.io/bootstrap-italia/docs/componenti/hero/
 * Latest revision: v2.6.1
 */
#}
{% apply spaceless %}
  {% include '@bi-bcl/deprecated.html.twig' with {
    old: 'bootstrap_italia_components/hero/hero.twig',
    new: 'bi-bcl/hero/hero.html.twig',
  } %}

  {# node_url and node_title are used special variant and in the card footer #}
  {#{% set node_url = call_to_action['node_link']['0']['0']['#context']['entity_url']|render %}#}
  {% set node_url = call_to_action|render|striptags %}

  {# Redirect to new component #}
  {% embed '@bi-bcl/hero/hero.html.twig' with {
    hero_kicker: subhead,
    hero_title: titolo,
    hero_text: paragrafo,
    hero_cta_url: node_url,
    hero_cta_label: 'Read more'|t,
    hero_cta_type: image ? 'secondary' : 'outline-primary',
    hero_small:
      variant == 'small' or
      variant == 'small_overlay' or
      variant == 'small_overlay_primario' or
      variant == 'small_overlay_filter' or
      variant == 'small_text_center' or
      variant == 'small_negative_margin' ?
      true : false,
    hero_overlay_color:
      variant == 'small_overlay' or
      variant == 'small_overlay_primario' or
      variant == 'small_overlay_filter' or
      variant == 'small_negative_margin' or
      variant == 'default_overlay' or
      variant == 'default_overlay_primario' or
      variant == 'default_negative_margin' ?
      'primary' : '',
    hero_image_src: '',
    hero_image_alt: '',
    hero_image_title: '',
    hero_image_light:
      variant == 'small_overlay' or
      variant == 'small_negative_margin' or
      variant == 'default_overlay' or
      variant == 'default_negative_margin' ?
      true : false,
    hero_image_filter:
      variant == 'small_overlay_filter' or
      variant == 'default_overlay_filter' ?
      true : false,
    hero_text_centered:
      variant == 'small_text_center' or
      variant == 'default_text_center' ?
      true : false,
    hero_overlapping_content:
      variant == 'small_negative_margin' or
      variant == 'default_negative_margin' ?
      true : false,
  } %}
    {% block heroImage %}
      {% if image %}
        <div class="img-responsive-wrapper">
          <div class="img-responsive">
            <div class="img-wrapper">
              {{ image }}
            </div>
          </div>
        </div>
      {% endif %}
    {% endblock %}
  {% endembed %}

{% endapply %}

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

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