templates/frontend-eforum/_partials/product-box.html.twig line 1

Open in your IDE?
  1. <article class="product-box product-box--product {% if class is defined %}{{ class }}{% endif %}">
  2.     <div class="product-box__inner">
  3.         <header class="product-box__header">
  4.             {% if product.categories.first is defined %}
  5.                 <a href="{{ path('efShowProduct', {
  6.                     categorySlug:           product.getParentCategorySlug,
  7.                     categoryChildSlug:      product.getCategorySlug,
  8.                     productAssociationSlug: product.slug
  9.                 }) }}"
  10.                    title="{{ product.title }}">
  11.                     {% if product.productImages is not empty %}
  12.                         <img class="product-box__thumbnail product-box__image"
  13.                              src="{{ vich_uploader_asset(product.productImages[0], 'imageFile') }}"
  14.                              alt=""
  15.                         >
  16.                     {% endif %}
  17.                 </a>
  18.             {% endif %}
  19.         </header>
  20.         <footer class="product-box__footer">
  21.             {% if product.title is not empty %}
  22.                 <h2 class="product-box__title">{{ product.title }}</h2>
  23.             {% endif %}
  24.             {% if product.categories.first is not empty %}
  25.                 <h3 class="product-box__category">{{ product.categories.first.categoryName }}</h3>
  26.             {% endif %}
  27.             {% if product.frontendDescriptionShort is not empty %}
  28.                 <p class="product-box__paragraph visible-xs">
  29.                     {{ product.frontendDescriptionShort }}
  30.                 </p>
  31.             {% elseif product.frontendDescription is not empty %}
  32.                 <p class="product-box__paragraph visible-xs">
  33.                     {{ product.frontendDescription }}
  34.                 </p>
  35.             {% endif %}
  36.             {% if product.categories.first is not empty %}
  37.             <footer class="product-box__description-footer visible-xs">
  38.                 <a class="product-box__link" href="{{ path('efShowProduct', {
  39.                     categorySlug:           product.getParentCategorySlug,
  40.                     categoryChildSlug:      product.getCategorySlug,
  41.                     productAssociationSlug: product.slug
  42.                 }) }}">
  43.                     Zobacz więcej
  44.                 </a>
  45.             </footer>
  46.             {% endif %}
  47.         </footer>
  48.         <div class="product-box__overlay">
  49.             <button class="button button--white button--thin product-box__preview jsToggleProductPreview"
  50.                     data-url="{{ path('efProductPreview', {
  51.                         'productAssociationId': product.id,
  52.                         'type': 'product'
  53.                     }) }}"
  54.             >
  55.                 Szybki podgląd
  56.             </button>
  57.             <div class="product-box__description {% if kcShortDesc is defined %}product-box__description--short{% endif %}">
  58.                 {% if product.categories.first is not empty %}
  59.                     <h3 class="product-box__category">{{ product.categories.first.categoryName }}</h3>
  60.                 {% endif %}
  61.                 {% if product.title is not empty %}
  62.                     <h2 class="product-box__title">{{ product.title }}</h2>
  63.                 {% endif %}
  64.                 {% if product.frontendDescriptionShort is not empty %}
  65.                     <p class="product-box__paragraph">
  66.                         {% set productShortWordsArray = product.frontendDescriptionShort|split(' ') %}
  67.                         {% if productShortWordsArray|length > 20 %}
  68.                             {{ productShortWordsArray|slice(0, 20)|join(' ') }}
  69.                         {% else %}
  70.                             {{ productShortWordsArray|join(' ') }}
  71.                         {% endif %}
  72.                     </p>
  73.                 {% elseif product.frontendDescription is not empty %}
  74.                     <p class="product-box__paragraph">
  75.                         {% set productWordsArray = product.frontendDescription|split(' ') %}
  76.                         {% if productWordsArray|length > 20 %}
  77.                             {{ productWordsArray|slice(0, 20)|join(' ') }}
  78.                         {% else %}
  79.                             {{ productWordsArray|join(' ') }}
  80.                         {% endif %}
  81.                     </p>
  82.                 {% endif %}
  83.                 {% if product is not empty %}
  84.                 <footer class="product-box__description-footer">
  85.                     <a class="product-box__link" href="{{ path('efShowProduct', {
  86.                         categorySlug:           product.getParentCategorySlug,
  87.                         categoryChildSlug:      product.getCategorySlug,
  88.                         productAssociationSlug: product.slug
  89.                     }) }}">
  90.                         Zobacz więcej
  91.                     </a>
  92.                 </footer>
  93.                 {% endif %}
  94.             </div>
  95.         </div>
  96.     </div>
  97. </article>