custom/plugins/ChespackTheme/src/Resources/views/storefront/page/content/detail.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/content/detail.html.twig' %}
  2. {# Added category background image #}
  3. {% block page_content_section %}
  4.     {% if section.name == "category-landing-page-header" or section.name == "category-page-header" %}
  5.         {% set category = page.header.navigation.active %}
  6.         {% if category.media %}
  7.             {% set categoryBg = "background-image: url('" ~ category.media.url ~ "'), linear-gradient(180deg, #FFFFFF 0%, #F1F1F1 100%); background-repeat: no-repeat; background-position-y: 45px; background-position-x: 80%" %}
  8.         {% else %}
  9.             {% set categoryBg = "background-image: linear-gradient(180deg, #FFFFFF 0%, #F1F1F1 100%); background-repeat: repeat-x; background-position-y: 45px;" %}
  10.         {% endif %}
  11.         <div class="cms-section {{ sectionClasses|join(' ') }}"
  12.              style="{% if sectionBgColor %}background-color: {{ sectionBgColor }};{% endif %}{% if categoryBg %}{{ categoryBg }}{% endif %}">
  13.             {% sw_include "@Storefront/storefront/section/cms-section-" ~ section.type ~ ".html.twig" %}
  14.         </div>
  15.     {% else %}
  16.         <div class="cms-section {{ sectionClasses|join(' ') }}"
  17.              style="{% if sectionBgColor %}background-color: {{ sectionBgColor }};{% endif %}{% if sectionBgImg %}background-image: url({{ sectionBgImg }});background-size: {{ section.backgroundMediaMode }};{% endif %}">
  18.             {% sw_include "@Storefront/storefront/section/cms-section-" ~ section.type ~ ".html.twig" %}
  19.         </div>
  20.     {% endif %}
  21. {% endblock %}