custom/plugins/zenitPlatformHorizon/src/Resources/views/storefront/page/content/index.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/content/index.html.twig' %}
  2. {% block base_main_inner %}
  3.     <div class="container-main">
  4.         {% block page_content %}
  5.             {# ... checks if custom zenit-breadcrumb is in use #}
  6.             {% set defaultBreadcrumbs = true %}
  7.             {% for section in page.cmsPage.sections %}
  8.                 {% for block in section.blocks %}
  9.                     {% if block.type is same as ('zenit-breadcrumb') %}
  10.                         {% set defaultBreadcrumbs = false %}
  11.                     {% endif %}
  12.                 {% endfor %}
  13.             {% endfor %}
  14.             {% if theme_config("zen-category-header-position") is same as ('absolute')
  15.                 or (theme_config("zen-category-header-position") is same as ('relative') and zenCustomFields.category.zenit_horizon_category_header_position is same as ('absolute')) %}
  16.                 {% set sectionCategoryOverlay = true %}
  17.             {% endif %}
  18.             {% if theme_config("zen-category-image") is same as (true) and zenCustomFields.category.zenit_horizon_category_image is not same as ('hide')
  19.                 or ( theme_config("zen-category-image") is same as (false) and (zenCustomFields.category.zenit_horizon_category_image is same as ('display')) ) %}
  20.                 {% set allowCategoryImage = true %}
  21.             {% endif %}
  22.             {# ... checks if there is either a category image or a
  23.             section image to prevent unwanted hero-sections #}
  24.             {% set hasCategoryImage = false %}
  25.             {% if allowCategoryImage %}
  26.                 {% set categoryMedia = page.header.navigation.active.media %}
  27.                 {% if categoryMedia %}
  28.                     {% set hasCategoryImage = true %}
  29.                 {% else %}
  30.                     {# ... there is not category media, so we have to check if there exists any fallback #}
  31.                     {% for section in page.cmsPage.sections %}
  32.                         {% if loop.index is same as (1) %}
  33.                             {% set sectionBgImg = section.backgroundMedia|sw_encode_media_url %}
  34.                             {% if sectionBgImg %}
  35.                                 {% set hasCategoryImage = true %}
  36.                             {% endif %}
  37.                         {% endif %}
  38.                     {% endfor %}
  39.                 {% endif %}
  40.             {% endif %}
  41.             {% if zenCustomFields.category.zenit_horizon_category_image_color is not empty %}
  42.                 {% set hasCategoryBgColor = true %}
  43.             {% endif %}
  44.             {% if hasCategoryBgColor is same as (true) or hasCategoryImage is same as (true) %}
  45.                 {% set isHeroSection = true %}
  46.             {% endif %}
  47.             {# ... if not a hero section #}
  48.             {% if isHeroSection is not same as (true) and defaultBreadcrumbs %}
  49.                 {# ... check if there is any breadcrumb to show #}
  50.                 {% if sw_breadcrumb_full(page.header.navigation.active, context.context) %}
  51.                     <div class="breadcrumb-container">
  52.                         <div class="container">
  53.                             <div class="breadcrumb-wrap cms-breadcrumb justify-content-{{ theme_config('zen-breadcrumbs-align')|replace({'flex-': ''}) }}">
  54.                                 {% block cms_breadcrumb %}
  55.                                     {% sw_include '@Storefront/storefront/layout/breadcrumb.html.twig' with {
  56.                                         navigationTree: page.header.navigation.tree,
  57.                                         category: page.header.navigation.active
  58.                                     } only %}
  59.                                 {% endblock %}
  60.                             </div>
  61.                         </div>
  62.                     </div>
  63.                 {% endif %}
  64.             {% endif %}
  65.             {% block cms_content %}
  66.                 {% set cmsPageClasses = ('cms-page ' ~ page.cmsPage.cssClass|striptags)|trim %}
  67.                 <div class="{{ cmsPageClasses }}">
  68.                     {% block page_content_blocks %}
  69.                         {% sw_include "@Storefront/storefront/page/content/detail.html.twig" with {
  70.                             'cmsPage': page.cmsPage,
  71.                             'defaultBreadcrumbs': defaultBreadcrumbs,
  72.                             'sectionCategoryOverlay': sectionCategoryOverlay,
  73.                             'hasCategoryImage': hasCategoryImage,
  74.                             'hasCategoryBgColor': hasCategoryBgColor,
  75.                             'isHeroSection': isHeroSection
  76.                         } %}
  77.                     {% endblock %}
  78.                 </div>
  79.             {% endblock %}
  80.         {% endblock %}
  81.     </div>
  82. {% endblock %}