templates/platform/component/atom/link_img_static.html.twig line 1

Open in your IDE?
  1. {# configuration example
  2. ###########
  3. class:   col-md-4
  4. enabled: true
  5. link:
  6.     enabled: false
  7.     tel:     ''
  8.     mailto:  ''
  9.     url:     ''
  10.     route:   ''
  11.     params:  ''
  12.     class:   ''
  13.     target:  _self
  14. img:
  15.     url:   ''
  16.     alt:   'test test'
  17.     class: ''
  18. #}
  19. {% if canDisplayComponent(app.user, value) %}
  20.     {% set link = value.img.link is defined ? value.img.link : value.link  %}
  21.     {% if link.enabled is not defined or link.enabled %}
  22.         {% set url = getItemLink(link)%}
  23.         {% if url is not same as('') %}
  24.             <a href="{{ url }}"
  25.            {% if link.class is defined %}class="{{ link.class }}"{% endif %}
  26.                 {% if link.target is defined %}target="{{ link.target }}"{% endif %}>
  27.         {% endif %}
  28.     {% endif %}
  29.         {% include '/platform/component/atom/img_static.html.twig' with {'img': value.img} %}
  30.     {% if url is defined and url is not null %}
  31.         </a>
  32.     {% endif %}
  33. {% endif %}