custom/plugins/TcinnThemeWareClean/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. {# TODO: prüfen... #}
  3. {# ---------------- START: SET TEMPLATE VARS ---------------- #}
  4. {# ThemeWare: Set theme variables #}
  5. {% set twtProductDetailCrossSellingShow = theme_config('twt-product-detail-cross-selling-show') %}
  6. {# ---------------- END: SET TEMPLATE VARS ---------------- #}
  7. {# TODO: HC-Architecture..! #}
  8. {# ThemeWare: Delete blocks if they are empty #}
  9. {% block section_content_block %}
  10.     {% set showBlock = true %}
  11.     
  12.     {# ThemeWare: Check if 'Cross Selling' block is used #}
  13.     {% if block.type == 'cross-selling' and twtProductDetailCrossSellingShow == 1 %}
  14.         {% for element in block.slots %}
  15.             {# ThemeWare: Check if 'Cross Selling' element is available #}
  16.             {% if element.type == 'cross-selling' %}
  17.                 {% if element.data.crossSellings is not empty %} {# element.data.crossSellings.elements #}
  18.                     {# ThemeWare: 'Cross Selling' element available and NOT empty = show block #}
  19.                     {% set showBlock = true %}
  20.                 {% else %}
  21.                     {# ThemeWare: 'Cross Selling' element available but empty = hide block #}
  22.                     {% set showBlock = false %}
  23.                 {% endif %}
  24.             {% else %}
  25.                 {# ThemeWare: Not a 'Cross Selling' element #}
  26.                 {% set showBlock = true %}
  27.             {% endif %}
  28.         {% endfor %}
  29.     {% endif %}
  30.     
  31.     {# ThemeWare: Check if 'listing subcategories' block is used #}
  32.     {% if block.type == 'twt-listing-subcategories' %}
  33.         {# ThemeWare: Check if subcategories existing #}
  34.         {% if page.header.navigation.active.childCount is empty or page.header.navigation.active.childCount == 0 %}
  35.             {# ThemeWare: No subcategories existing = hide block #}
  36.             {% set showBlock = false %}
  37.         {% endif %}
  38.     {% endif %}
  39.     
  40.     {% if showBlock %}
  41.         {# Default block = show block #}
  42.         {{ parent() }}
  43.     {% endif %}
  44. {% endblock %}