templates/product/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{{ 'PRODUCT'|trans }}{% endblock %}
  3. {% block head %}
  4.     {{ parent() }}
  5.     <meta name="description" content="{{ 'PRODUCT_META_DESCRIPTION'|trans}}">
  6.     <meta name="keywords" content="{% for product in productPaginator.result %}{{ product.title }}, {% endfor %}">
  7. {% endblock %}
  8. {% block body %}
  9.     <main>
  10.         <section class="komili-home-hero owl-carousel">
  11.             {% for item in sliderItemPaginator.result %}
  12.                 <div class="hero-item">
  13.                     <a {% if item.pathUrl %}href="{{ item.pathUrl }}"{% else %}href="javascript:;" {% endif %}>
  14.                         <img src="{{ item.image.url }}" alt="{{ item.image.originalName }}">
  15.                     </a>
  16.                 </div>
  17.             {% endfor %}
  18.         </section>
  19.         <section class="komili-home-products">
  20.             <div class="komili-wrapper">
  21.                 <h1 class="text-center bold text-color-p mb-24 h2">{{ 'PRODUCTS' | trans }}</h1>
  22.                 <div class="komili-home-products-slider komili-product-page-products">
  23.                     {% for product in productPaginator.result %}
  24.                         <div class="komili-home-products-item">
  25.                             <a href="{{ path('product_item', {'categorySlug': product.slug }) }}">
  26.                                 <figure>
  27.                                     <img src="{{ product.image.url }}" alt={{ product.title }} width="200" height="200" loading="lazy">
  28.                                 </figure>
  29.                                 <div class="text">
  30.                                     <h3 class="bold text-color-p h4 mb-10">{{ product.title }}</h3>
  31.                                     <p class="text-black mb-0">{{ product.shortContent }}</p>
  32.                                 </div>
  33.                             </a>
  34.                         </div>
  35.                     {% endfor %}
  36.                 </div>
  37.             </div>
  38.         </section>
  39.         {% for product in productPaginator.result %}
  40.             <div itemscope itemtype="http://schema.org/Product">
  41.                 <meta itemscope itemprop="mainEntityOfPage"  itemType="https://schema.org/WebPage" itemid="{{ url('product_item', {'categorySlug': product.slug }) }}"/>
  42.                 <meta itemprop="headline" content="{{ product.title }}">
  43.                 <h3 itemprop="author" itemscope itemtype="https://schema.org/Person">
  44.                     <meta itemprop="name" content="Komili">
  45.                 </h3>
  46.                 <meta itemprop="description" content="{{ product.shortContent }}"/>
  47.                 <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
  48.                     <meta itemprop="url" content="{{ product.image.url }}">
  49.                 </div>
  50.                 <div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
  51.                     <div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
  52.                         <meta itemprop="url" content="{{ absolute_url('/img/komili-logo.svg') }}">
  53.                     </div>
  54.                     <meta itemprop="name" content="Komili">
  55.                 </div>
  56.                 <meta itemprop="datePublished" content="{{ product.createdAt|date('Y-m-d') }}T{{ product.createdAt|date('H:s') }}"/>
  57.                 <meta itemprop="dateModified" content="{{ product.updatedAt|date('Y-m-d') }}T{{ product.updatedAt|date('H:s') }}"/>
  58.             </div>
  59.         {% endfor %}
  60.     </main>
  61. {% endblock %}
  62. {% block javascripts %}
  63.     {{ parent() }}
  64.     <script>
  65.         $(".komili-home-hero").owlCarousel({
  66.             loop: true,
  67.             nav: true,
  68.             lazyLoad: true,
  69.             margin: 0,
  70.             items: 1,
  71.             autoplay: true,
  72.             autoplayTimeout: 6000,
  73.             autoplayHoverPause: true
  74.         });
  75.     </script>
  76. {% endblock %}