custom/plugins/zenitPlatformStratus/src/Resources/views/storefront/section/cms-section-block-container.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/section/cms-section-block-container.html.twig' %}
  2. {% block section_content_block_background_image %}
  3.     {% if block.backgroundMedia %}
  4.         {% set attributes = {
  5.             class: "cms-block-background media-mode--" ~ block.backgroundMediaMode
  6.         } %}
  7.         {# ... enables lazy loading for images #}
  8.         {% if config('zenitPlatformStratus.config.lazyloading') %}
  9.             {% set attributes = attributes|merge({ 'loading': 'lazy' }) %}
  10.         {% endif %}
  11.         {% sw_thumbnails 'cms-block-background' with {
  12.             media: block.backgroundMedia
  13.         } %}
  14.     {% endif %}
  15. {% endblock %}
  16. {% block section_content_block_container %}
  17.     {# ... add auto settings as fallback #}
  18.     {# ... if null or auto, use value from the css stylesheet! #}
  19.     {% set top = block.marginTop|length ? block.marginTop : 'auto' %}
  20.     {% set right = block.marginRight|length ? block.marginRight : 'auto' %}
  21.     {% set bottom = block.marginBottom|length ? block.marginBottom : 'auto' %}
  22.     {% set left = block.marginLeft|length ? block.marginLeft : 'auto' %}
  23.     {# ... set horizontal auto spacings for locked cms product_detail default page #}
  24.     {% if cmsPage.type === 'product_detail' and cmsPage.locked === true %}
  25.         {% if block.marginLeft === '0' %}
  26.             {% set left = 'auto' %}
  27.         {% endif %}
  28.         {% if block.marginRight === '0' %}
  29.             {% set right = 'auto' %}
  30.         {% endif %}
  31.     {% endif %}
  32.     {# ... set horizontal auto spacings for locked cms product_list default page #}
  33.     {% if cmsPage.type === 'product_list' and cmsPage.locked === true %}
  34.         {% if block.marginLeft === '20px' %}
  35.             {% set left = 'auto' %}
  36.         {% endif %}
  37.         {% if block.marginRight === '20px' %}
  38.             {% set right = 'auto' %}
  39.         {% endif %}
  40.     {% endif %}
  41.     {# ... split padding into separeted properties #}
  42.     {# ... using padding instead of margins to prevent collapsing margins #}
  43.     <div class="cms-block-container"
  44.          style="{% if top is not same as ('auto') %}padding-top: {{ top }};{% endif %}{% if right is not same as ('auto') %} padding-right: {{ right }};{% endif %}{% if bottom is not same as ('auto') %} padding-bottom: {{ bottom }};{% endif %}{% if left is not same as ('auto') %} padding-left: {{ left }};{% endif %}">
  45.         {{ block('section_content_block_row') }}
  46.     </div>
  47. {% endblock %}