custom/static-plugins/BaumarktTheme/src/Resources/views/storefront/page/content/index.html.twig line 66

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/content/index.html.twig' %}
  2. {% block page_content %}
  3.     {% if page.cmsPage.type == 'product_list' %}
  4.         {% set categoryCustomFields = page.header.navigation.active.translated.customFields %}
  5.         {% if categoryCustomFields.category_cover_img %}
  6.             {% set coverImgId = categoryCustomFields.category_cover_img %}
  7.             {% set coverImgMediaCollection = searchMedia([coverImgId], context.context) %}
  8.             {% set coverImgMedia = coverImgMediaCollection.get(coverImgId) %}
  9.         {% endif %}
  10.         {% block page_content_cover_image %}
  11.             {% if coverImgMedia %}
  12.                 <div class="category-cover-img" style="background-image: url({{ coverImgMedia.url|sw_encode_url }});">
  13.                     <div class="category-cover-img-layer"></div>
  14.                     <div class="category-cover-img-name">
  15.                         <h1>{{ page.header.navigation.active.translated.name }}</h1>
  16.                     </div>
  17.                 </div>
  18.             {% endif %}
  19.         {% endblock %}
  20.         {% set linkableSections = [] %}
  21.         {% for section in page.cmsPage.sections %}
  22.             {% if section.name %}
  23.                 {% set linkableSections = linkableSections|merge([section]) %}
  24.             {% endif %}
  25.         {% endfor %}
  26.         {% if linkableSections|length > 0 %}
  27.             <div class="listing-page-navigation" data-scroll-section>
  28.                 <ul>
  29.                     {% for section in linkableSections %}
  30.                         {% set sectionNameSnippet = section.name|striptags|replace({' ': ''}) %}
  31.                         {% set sectionName = sectionNameSnippet|trans|sw_sanitize %}
  32.                         {% if sectionNameSnippet == sectionName %}
  33.                             {% set sectionName = section.name %}
  34.                         {% endif %}
  35.                         <li>
  36.                             <a href="#" data-section-id="globus-listing-section-{{ section.id }}">{{ sectionName }}</a>
  37.                         </li>
  38.                     {% endfor %}
  39.                 </ul>
  40.             </div>
  41.         {% endif %}
  42.     {% endif %}
  43.     {% block cms_breadcrumb %}
  44.         {% if controllerAction == 'home' %}
  45. {# removes breadcrumb navigation on homepage to prevent unneccesary whitespace #}
  46.         {% else %}
  47.             <div class="breadcrumb cms-breadcrumb container" data-content-breadcrumb="true">
  48.                 {% sw_include '@Storefront/storefront/layout/breadcrumb.html.twig' with {
  49.                     context: context,
  50.                     category: page.header.navigation.active
  51.                 } only %}
  52.             </div>
  53.         {% endif %}
  54.     {% endblock %}
  55.     {% block page_content_subcategories_wrapper %}
  56.         {% set treeItems = page.header.navigation.tree %}
  57.         {% set currentLevel = page.header.navigation.active.level %}
  58.         {% set currentChildren = page.header.navigation.active.childCount %}
  59.         {% set activeId = page.header.navigation.active.id %}
  60.         {% if currentChildren > 0 %}
  61.             <div class="subcategories-navigation-wrapper">
  62.                 <div class="subcategories-navigation container d-flex justify-content-between">
  63.                     {% sw_include '@Storefront/storefront/page/content/subnavigation.html.twig' with { activeId: activeId, treeItems: treeItems} only %}
  64.                 </div>
  65.             </div>
  66.         {% endif %}
  67.     {% endblock %}
  68.     <div class="cms-page">
  69.         {% block page_content_blocks %}
  70.             {% sw_include "@Storefront/storefront/page/content/detail.html.twig" with {'cmsPage': page.cmsPage} %}
  71.         {% endblock %}
  72.     </div>
  73.     {% if page.cmsPage.type == 'product_list' %}
  74.         {% if page.header.navigation.active.translated.customFields.category_description_seo %}
  75.             <div class="cms-seo-text-wrapper">
  76.                 <div class="cms-seo-container container">
  77.                     {% if page.metaInformation.metaTitle %}
  78.                         <div class="h3 cms-seo-title">
  79.                             {{ page.metaInformation.metaTitle }}
  80.                         </div>
  81.                     {% endif %}
  82.                     {% if page.header.navigation.active.translated.customFields.category_subtitle_seo %}
  83.                         <div class="cms-seo-subtitle">
  84.                             {{ page.header.navigation.active.translated.customFields.category_subtitle_seo }}
  85.                         </div>
  86.                     {% endif %}
  87.                     <div class="cms-seo-description">
  88.                         <p>
  89.                             {{ page.header.navigation.active.translated.customFields.category_description_seo|raw }}
  90.                         </p>
  91.                     </div>
  92.                     <div class="cms-seo-btn-wrapper d-flex justify-content-center">
  93.                     <a href="{{ "listing.listingSeoBtnUrl"|trans }}
  94. " class="cms-seo-btn btn btn-primary">
  95.                         {{ "listing.listingSeoBtn"|trans }}
  96.                     </a>
  97.                     </div>
  98.                 </div>
  99.             </div>
  100.         {% endif %}
  101.     {% endif %}
  102. {% endblock %}