vendor/shopware/storefront/Resources/views/storefront/page/content/detail.html.twig line 1

Open in your IDE?
  1. {# @var cmsPage \Shopware\Core\Content\Cms\CmsPageEntity #}
  2. {# @var landingPage \Shopware\Core\Content\LandingPage\LandingPageEntity #}
  3. {% block page_content_sections_inner %}
  4.     <div class="cms-sections">
  5.         {% for section in cmsPage.sections %}
  6.             {% set sectionBgColor = section.backgroundColor %}
  7.             {% set sectionBgImg = section.backgroundMedia|sw_encode_media_url %}
  8.             {% set sectionBgImgMode = section.backgroundMediaMode %}
  9.             {% set sectionClasses = [section.cssClass, 'pos-' ~ section.position, 'cms-section-' ~ section.type] %}
  10.             {% if sectionBgImg %}
  11.                 {% set sectionClasses = ['bg-image']|merge(sectionClasses) %}
  12.             {% endif %}
  13.             {% if sectionBgColor %}
  14.                 {% set sectionClasses = ['bg-color']|merge(sectionClasses) %}
  15.             {% endif %}
  16.             {% if section.visibility is null %}
  17.                 {% set visibility = {
  18.                     mobile: true,
  19.                     tablet: true,
  20.                     desktop: true
  21.                 } %}
  22.             {% else %}
  23.                 {% set visibility = section.visibility %}
  24.             {% endif %}
  25.             {% if not visibility.mobile %}
  26.                 {% set sectionClasses = ['hidden-mobile']|merge(sectionClasses) %}
  27.             {% endif %}
  28.             {% if not visibility.tablet %}
  29.                 {% set sectionClasses = ['hidden-tablet']|merge(sectionClasses) %}
  30.             {% endif %}
  31.             {% if not visibility.desktop %}
  32.                 {% set sectionClasses = ['hidden-desktop']|merge(sectionClasses) %}
  33.             {% endif %}
  34.             {% block page_content_section %}
  35.                 <div class="cms-section {{ sectionClasses|join(' ') }}"
  36.                      style="{% if sectionBgColor %}background-color: {{ sectionBgColor }};{% endif %}{% if sectionBgImg %}background-image: url({{ sectionBgImg }});background-size: {{ section.backgroundMediaMode }};{% endif %}">
  37.                     {% sw_include "@Storefront/storefront/section/cms-section-" ~ section.type ~ ".html.twig" %}
  38.                 </div>
  39.             {% endblock %}
  40.         {% endfor %}
  41.     </div>
  42. {% endblock %}