{% sw_extends '@Storefront/storefront/page/content/index.html.twig' %}
{% block page_content %}
{% if page.cmsPage.type == 'product_list' %}
{% set categoryCustomFields = page.header.navigation.active.translated.customFields %}
{% if categoryCustomFields.category_cover_img %}
{% set coverImgId = categoryCustomFields.category_cover_img %}
{% set coverImgMediaCollection = searchMedia([coverImgId], context.context) %}
{% set coverImgMedia = coverImgMediaCollection.get(coverImgId) %}
{% endif %}
{% block page_content_cover_image %}
{% if coverImgMedia %}
<div class="category-cover-img" style="background-image: url({{ coverImgMedia.url|sw_encode_url }});">
<div class="category-cover-img-layer"></div>
<div class="category-cover-img-name">
<h1>{{ page.header.navigation.active.translated.name }}</h1>
</div>
</div>
{% endif %}
{% endblock %}
{% set linkableSections = [] %}
{% for section in page.cmsPage.sections %}
{% if section.name %}
{% set linkableSections = linkableSections|merge([section]) %}
{% endif %}
{% endfor %}
{% if linkableSections|length > 0 %}
<div class="listing-page-navigation" data-scroll-section>
<ul>
{% for section in linkableSections %}
{% set sectionNameSnippet = section.name|striptags|replace({' ': ''}) %}
{% set sectionName = sectionNameSnippet|trans|sw_sanitize %}
{% if sectionNameSnippet == sectionName %}
{% set sectionName = section.name %}
{% endif %}
<li>
<a href="#" data-section-id="globus-listing-section-{{ section.id }}">{{ sectionName }}</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endif %}
{% block cms_breadcrumb %}
{% if controllerAction == 'home' %}
{# removes breadcrumb navigation on homepage to prevent unneccesary whitespace #}
{% else %}
<div class="breadcrumb cms-breadcrumb container" data-content-breadcrumb="true">
{% sw_include '@Storefront/storefront/layout/breadcrumb.html.twig' with {
context: context,
category: page.header.navigation.active
} only %}
</div>
{% endif %}
{% endblock %}
{% block page_content_subcategories_wrapper %}
{% set treeItems = page.header.navigation.tree %}
{% set currentLevel = page.header.navigation.active.level %}
{% set currentChildren = page.header.navigation.active.childCount %}
{% set activeId = page.header.navigation.active.id %}
{% if currentChildren > 0 %}
<div class="subcategories-navigation-wrapper">
<div class="subcategories-navigation container d-flex justify-content-between">
{% sw_include '@Storefront/storefront/page/content/subnavigation.html.twig' with { activeId: activeId, treeItems: treeItems} only %}
</div>
</div>
{% endif %}
{% endblock %}
<div class="cms-page">
{% block page_content_blocks %}
{% sw_include "@Storefront/storefront/page/content/detail.html.twig" with {'cmsPage': page.cmsPage} %}
{% endblock %}
</div>
{% if page.cmsPage.type == 'product_list' %}
{% if page.header.navigation.active.translated.customFields.category_description_seo %}
<div class="cms-seo-text-wrapper">
<div class="cms-seo-container container">
{% if page.metaInformation.metaTitle %}
<div class="h3 cms-seo-title">
{{ page.metaInformation.metaTitle }}
</div>
{% endif %}
{% if page.header.navigation.active.translated.customFields.category_subtitle_seo %}
<div class="cms-seo-subtitle">
{{ page.header.navigation.active.translated.customFields.category_subtitle_seo }}
</div>
{% endif %}
<div class="cms-seo-description">
<p>
{{ page.header.navigation.active.translated.customFields.category_description_seo|raw }}
</p>
</div>
<div class="cms-seo-btn-wrapper d-flex justify-content-center">
<a href="{{ "listing.listingSeoBtnUrl"|trans }}
" class="cms-seo-btn btn btn-primary">
{{ "listing.listingSeoBtn"|trans }}
</a>
</div>
</div>
</div>
{% endif %}
{% endif %}
{% endblock %}