templates/areas/content-download/view.html.twig line 1

Open in your IDE?
  1. {% if editmode %}
  2.     {{ include('includes/editmode-settings.html.twig') }}
  3. {% endif %}
  4. <section class="accordion-area container content-block {{ not pimcore_input('anchorTitle').isEmpty() ? 'js-anchor-nav__item' }}"
  5.          {% if not pimcore_input('anchorTitle').isEmpty() %} data-anchor-nav-title="{{ pimcore_input('anchorTitle').getData() }}" {% endif %}
  6. >
  7.     <div class="container-narrow">
  8.         {{ include('includes/title-blocks/title-block.html.twig') }}
  9.         {% if editmode %}
  10.             <div class="editmode-box">
  11.                 {{ pimcore_relations('downloads', {
  12.                     "types": ["asset"],
  13.                     "subtypes": {
  14.                         "asset": ["image", "document", "video"],
  15.                     },
  16.                     "title": "Use images, videos or PDF's",
  17.                 }) }}
  18.             </div>
  19.         {% endif %}
  20.         <div class="d-flex flex-column">
  21.             <ul class="list-unstyled">
  22.                 {% for download in pimcore_relations('downloads').elements %}
  23.                     {% if download %}
  24.                         <li>
  25.                             <a href="{{ download }}" target="_blank" download class="download d-flex align-items-center m-2">
  26.                                 <span class="download__icon icon icon-download text-secondary me-2" aria-hidden="true"></span>
  27.                                 <span class="text-secondary font-bold">{{ download.metadata('title')|default(download.key) }}</span>
  28.                                 <span class="text-muted ms-2 text-nowrap">({{ download.getMimetype()|split('/')|last|upper }}, {{ (download.getFileSize('kb')) }})</span>
  29.                             </a>
  30.                         </li>
  31.                     {% endif %}
  32.                 {% endfor %}
  33.             </ul>
  34.         </div>
  35.     </div>
  36. </section>