templates/includes/blocks/image.html.twig line 1

Open in your IDE?
  1. {% set displayOption = view.image.displayOption|default('top') %}
  2. {# we write the image into a variable to and then place it at the correct position depending on displayOption #}
  3. {% set image %}
  4.     {% set defaultFormat = '1380x' %}
  5.     {% set mobileFormat = '991x' %}
  6.     {% if displayOption in ['left', 'right'] %}
  7.         {% set defaultFormat = '400x' %}
  8.         {% set mobileFormat = '400x' %}
  9.     {% endif %}
  10.     <div class="block-image block-image__{{ displayOption }}">
  11.         {# @see https://github.com/sulu/web-twig/blob/v2.4.0/docs/image.md #}
  12.         {# get_image(content.image|default, defaultFormat, {
  13.             '(max-width: 991px)': mobileFormat,
  14.         }) #}
  15.     </div>
  16. {% endset %}
  17. {{ image }} 
  18. {% if displayOption == "top" %} 
  19.  <img src="{{content.image.url}}" alt="" class="parallax w-100"/>
  20.  
  21.  {% else %}
  22.  <img src="{{content.image.url}}" alt="" class="w-100"/>
  23.  {% endif %}