templates/content/thumbnails.html.twig line 1

Open in your IDE?
  1. {% extends 'layouts/layout.html.twig' %}
  2. {% block content %}
  3.     <div id="main-content" class="main-content" >
  4.         {{ include('includes/content-headline.html.twig') }}
  5.         {# this is just used for demonstration #}
  6.         {% set image =  pimcore_image('image').getImage() ?: pimcore_asset(341) %}
  7.         <p>
  8.             {{ 'Original Dimensions of the Image:'|trans }}
  9.             {{ image.width }} x {{ image.height }}
  10.         </p>
  11.         <div class="mb-5">
  12.             {{ pimcore_image('image', { thumbnail: 'content', imgAttributes: {class: 'img-responsive'}}) }}
  13.         </div>
  14.         {% set thumbnails = {
  15.             'Cover': 'exampleCover',
  16.             'Contain': 'exampleContain',
  17.             'Frame': 'exampleFrame',
  18.             'Rotate': 'exampleRotate',
  19.             'Resize': 'exampleResize',
  20.             'Scale by Width': 'exampleScaleWidth',
  21.             'Scale by Height': 'exampleScaleHeight',
  22.             'Contain & Overlay': 'exampleOverlay',
  23.             'Rounded Corners': 'exampleCorners',
  24.             'Colors': 'exampleColor',
  25.             'Sepia': 'exampleSepia',
  26.             'Grayscale': 'exampleGrayscale',
  27.             'Mask': 'exampleMask',
  28.             'Combined 1': 'exampleCombined1',
  29.             'Combined 2': 'exampleCombined2'
  30.         } %}
  31.         <section class="thumbnail-examples">
  32.             {% for title, name in thumbnails %}
  33.                 {% if loop.index0 % 3 == 0 %}
  34.                     <div class="row">
  35.                 {% endif %}
  36.                 <div class="col-lg-4">
  37.                     {% set thumbnail = image.getThumbnail(name) %}
  38.                     <div class="img-container">
  39.                         {{ thumbnail.getHTML()|raw }}
  40.                     </div>
  41.                     <h5>{{ title|trans }}</h5>
  42.                     <div class="img-dimensions">
  43.                         {{ 'Dimensions:'|trans }}
  44.                         {{ thumbnail.width }} x {{ thumbnail.height }}
  45.                     </div>
  46.                 </div>
  47.                 {% if loop.last or ((loop.index0 + 1) % 3 == 0) %}
  48.                     </div>
  49.                 {% endif %}
  50.             {% endfor %}
  51.         </section>
  52.     </div>
  53.     {{ pimcore_areablock('content_bottom') }}
  54. {% endblock %}