drowl_paragraphs_bs-1.x-dev/modules/drowl_paragraphs_bs_type_image/templates/paragraph--drowl-paragraphs-bs--vector-image.html.twig

modules/drowl_paragraphs_bs_type_image/templates/paragraph--drowl-paragraphs-bs--vector-image.html.twig
{% extends "@drowl_paragraphs_bs_type_image/paragraph--drowl-paragraphs-bs--image.html.twig" %}

{% set image_link = paragraph.field_link.value|default(false) %}
{% set image_link_attributes = image_link_attributes|default(false) %}

{% if not image_link_attributes and image_link %}
  {% if image_link.0.options.attributes %}
    {% set image_link_attributes = image_link.0.options.attributes %}
  {% else %}
    {# Provide "fallback" link attributes #}
    {% set image_link_attributes = {'class':['image-link']} %}
  {% endif %}
{% endif %}

{% set image_rendered %}
  <div {{ image_wrapper_attributes.addClass('image-wrapper') }}>
    {{ content.field_vector_image|field_value }}
  </div>
{% endset %}

{% block content %}
  {% if not content.field_vector_image.0 is empty %}
    {% if image_link %}
      {{ link(image_rendered, image_link.0.uri, image_link_attributes) }}
    {% else %}
      {{ image_rendered }}
    {% endif %}
  {% endif %}
{% endblock content %}

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

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