templates/product/item/show.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{{ item.title }}{% endblock %}
  3. {% block body %}
  4. <main>
  5.     <section class="komili-product-detail">
  6.         <div class="komili-wrapper">
  7.             <div class="komili-product-detail-box">
  8.                 {% if item.properties|length > 0 %}
  9.                     <figure>
  10.                         <a href="#komili-modal-product-big" rel="modal:open">
  11.                             <img id="komili_cover_image" src="{{ item.properties[0].file.url }}" alt="{{ item.properties[0].title }}" class="m-auto">
  12.                         </a>
  13.                     </figure>
  14.                 {% else %}
  15.                     <figure>
  16.                         <a href="#komili-modal-product-big" rel="modal:open">
  17.                             <img src="{{ item.image.url }}" alt="{{ item.title }}" class="m-auto">
  18.                         </a>
  19.                     </figure>
  20.                 {% endif %}
  21.                 <div class="text">
  22.                     <h1 class="bold text-color-p mb-32">{{ item.title }}</h1>
  23.                     {% if item.properties|length > 0 %}
  24.                         <ul class="komili-product-amount">
  25.                             {% for key,p in item.properties %}
  26.                                 <li>
  27.                                     <a href="javascript:;" {% if key == 0 %} class="selected" {% endif %} data-image="{{ p.file.url }}">{{ p.title }}</a>
  28.                                 </li>
  29.                             {% endfor %}
  30.                         </ul>
  31.                     {% endif %}
  32.                     <p>{{ item.content|raw }}</p>
  33.                 </div>
  34.             </div>
  35.         </div>
  36.     </section>
  37.     <div itemscope itemtype="http://schema.org/Product">
  38.         <meta itemscope itemprop="mainEntityOfPage"  itemType="https://schema.org/WebPage" itemid="{{ url('product_item_show', { 'categorySlug': item.product.slug, 'itemSlug': item.slug}) }}"/>
  39.         <meta itemprop="headline" content="{{ item.title }}">
  40.         <h3 itemprop="author" itemscope itemtype="https://schema.org/Person">
  41.             <meta itemprop="name" content="Komili">
  42.         </h3>
  43.         <meta itemprop="description" content="{{ item.content }}"/>
  44.         <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
  45.             <meta itemprop="url" content="{{ item.image.url }}">
  46.         </div>
  47.         <div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
  48.             <div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
  49.                 <meta itemprop="url" content="{{ absolute_url('/img/komili-logo.svg') }}">
  50.             </div>
  51.             <meta itemprop="name" content="Komili">
  52.         </div>
  53.         <meta itemprop="datePublished" content="{{ item.createdAt|date('Y-m-d') }}T{{ item.createdAt|date('H:s') }}"/>
  54.         <meta itemprop="dateModified" content="{{ item.updatedAt|date('Y-m-d') }}T{{ item.updatedAt|date('H:s') }}"/>
  55.     </div>
  56. </main>
  57.     {% if item.properties|length == 0 %}
  58.     <div class="modal" id="komili-modal-product-big">
  59.         <div class="w-100" style="display: flex; justify-content: center">
  60.             <img src="{{ item.image.url }}" alt="{{ item.title }}">
  61.         </div>
  62.     </div>
  63.     {% endif %}
  64. {% endblock %}