templates/page/product/list.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block page_title %}
  3.     {{ 'storefront.title'|resolve|striptags }} | Produkte
  4. {% endblock %}
  5. {% block head_custom_stylesheets %}
  6.     {{ encore_entry_link_tags('hero-header') }}
  7.     {{ encore_entry_link_tags('product-card') }}
  8. {% endblock head_custom_stylesheets %}
  9. {% block content %}
  10.     {% if category and category.headerImage %}
  11.         <div class="hero-header" style="background-image: url(/images/{{ category.headerImage }});">
  12.             <div class="hero-header-inner">
  13.                 <div class="container-3xl">
  14.                     <div class="row">
  15.                         <div class="col-12">
  16.                             <h1 class="hero-headline mb-5 text-white">{{ 'product.list.page.headline'|resolve }}</h1>
  17.                         </div>
  18.                     </div>
  19.                 </div>
  20.             </div>
  21.         </div>
  22.     {% else %}
  23.         <div class="container-3xl mb-0 mt-5 mt-sm-5">
  24.             <div class="row">
  25.                 <div class="col-12">
  26.                     <h1 class="ornament-with-child">{{ 'product.list.page.headline'|resolve }}</h1>
  27.                 </div>
  28.             </div>
  29.         </div>
  30.     {% endif %}
  31.     <div class="container-3xl my-5">
  32.         <div class="row">
  33.             <div class="col-12">
  34.             {{ 'product.list.page.description'|resolve }}
  35.             </div>
  36.         </div>
  37.     </div>
  38.     <div class="product-cards container-3xl my-3 mb-sm-6">
  39.         <div class="row g-4 match-height-product" data-match-height-group="product-group">
  40.             {% if tenant.categories|length > 0 %}
  41.                 {% for product in tenant.products|filter(product => category in product.categories) %}
  42.                     {% set productConfig = product.config|json_decode %}
  43.                     <div class="col-12 col-md-6">
  44.                         <div data-match-height="product" class="product position-relative d-flex flex-column justify-content-between h-100 p-3 p-sm-5 bg-lightgrey">
  45.                             <div class="row">
  46.                                 <div class="col-12 col-sm-{{ product.listImage ? '8' : '12' }} order-2 order-sm-1">
  47.                                     <h4 class="mb-4">{{ product.name }}</h4>
  48.                                     <div>
  49.                                         <p class="line-clamp clamp-4">{{ product.shortDescription }}</p>
  50.                                         <ul id="product-config">
  51.                                             {% if productConfig.kim_addresses_included %}
  52.                                                 <li>
  53.                                                     {{ productConfig.kim_addresses.quantity }}x KIM Adressen
  54.                                                 </li>
  55.                                             {% endif %}
  56.                                             {% if productConfig.hardware_included %}
  57.                                                 {% for hardware in productConfig.hardware %}
  58.                                                     {% if hardware.quantity > 0 %}
  59.                                                         <li>
  60.                                                             {{ hardware.quantity }}x {{ hardware.hardware|resolve }}
  61.                                                         </li>
  62.                                                     {% endif %}
  63.                                                 {% endfor %}
  64.                                             {% endif %}
  65.                                         </ul>
  66.                                     </div>
  67.                                 </div>
  68.                                 {% if product.listImage %}
  69.                                     <div class="col-12 col-sm-4 order-1 order-sm-2 mb-4">
  70.                                         <img class="w-100" src="/images/{{ product.listImage }}" alt="{{ product.name }}">
  71.                                     </div>
  72.                                 {% endif %}
  73.                             </div>
  74.                             <a href="{{ path('product_details', {productId: product.id}) }}" class="d-flex justify-content-end align-items-center text-decoration-none fw-bold my-3 mt-sm-0"><span class="me-2">Mehr erfahren </span><i class="fas fa-arrow-right"></i></a>
  75.                         </div>
  76.                     </div>
  77.                 {% endfor %}
  78.             {% else %}
  79.                 {% for product in tenant.products %}
  80.                     {% set productConfig = product.config|json_decode %}
  81.                     <div class="col-xs-12 col-md-6 mb-3">
  82.                         <div class="product position-relative d-flex flex-column justify-content-between h-100 p-3 p-sm-5 bg-lightgrey">
  83.                             <div class="row">
  84.                                 <div class="col-xs-12 col-sm-{{ product.listImage ? '8' : '12' }} order-2 order-sm-1">
  85.                                     <h4 class="mb-4">{{ product.name }}</h4>
  86.                                     <div>
  87.                                         <p>{{ product.shortDescription }}</p>
  88.                                         <ul>
  89.                                             {% if productConfig.kim_addresses_included %}
  90.                                                 <li>
  91.                                                     {{ productConfig.kim_addresses.quantity }} KIM Adressen
  92.                                                 </li>
  93.                                             {% endif %}
  94.                                             {% if productConfig.hardware_included %}
  95.                                                 {% for hardware in productConfig.hardware %}
  96.                                                     <li>
  97.                                                         {{ hardware.quantity }} {{ hardware.hardware }}
  98.                                                     </li>
  99.                                                 {% endfor %}
  100.                                             {% endif %}
  101.                                         </ul>
  102.                                     </div>
  103.                                 </div>
  104.                                 {% if product.listImage %}
  105.                                     <div class="col-xs-12 col-sm-4 order-1 order-sm-2 mb-4">
  106.                                         <img class="w-100" src="/images/{{ product.listImage }}" alt="{{ product.name }}">
  107.                                     </div>
  108.                                 {% endif %}
  109.                             </div>
  110.                             <a href="{{ path('product_details', {productId: product.id}) }}" class="d-flex justify-content-end align-items-center text-decoration-none fw-bold"><span class="me-2">Mehr erfahren </span><i class="fas fa-arrow-right"></i></a>
  111.                         </div>
  112.                     </div>
  113.                 {% endfor %}
  114.             {% endif %}
  115.         </div>
  116.     </div>
  117. {% endblock %}