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

Open in your IDE?
  1. {% sw_extends '@parent/storefront/section/cms-section-block-container.html.twig' %}
  2. {# Shopware adds has--sidebar class to its blocks, we dont want those for Okeonline Sections #}
  3. {% block section_content_block_row %}
  4.     {% set salesChannelLanguage = context.salesChannel.languageId %}
  5.     {# Get attributes by block.name #}
  6.     {% set languageAttributes = block.name|split(' ')|filter(v => v starts with 'lang-') %}
  7.     {% set blockHasLanguageSwitch = languageAttributes|length > 0 %}
  8.     {% set showForCurrentLanguage = languageAttributes|filter(v => v == 'lang-'~salesChannelLanguage)|length > 0  %}
  9.     {% if blockHasLanguageSwitch is not true or showForCurrentLanguage %}
  10.         {% set isOkeonlineSection = sectionClasses|filter(sectionClass => '-oo_' in sectionClass)|length > 0 %}
  11.         {% set sidebarClasses = isOkeonlineSection ? '' : sidebarClasses %}
  12.         <div class="cms-block-container-row row cms-row {{ sidebarClasses }}">
  13.             {% sw_include "@Storefront/storefront/block/cms-block-" ~ block.type ~ ".html.twig" ignore missing %}
  14.         </div>
  15.     {% endif %}
  16. {% endblock %}