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

Open in your IDE?
  1. <section class="wysiwyg-area content-block js-fade-in
  2. {{ include('Layout/includes/editmode-box-classes.html.twig') }} {{ styleModifier | default(null) }} {{ not pimcore_input('anchorTitle').empty ? 'js-anchor-nav__item' : '' }}"
  3.          {% if not pimcore_input('anchorTitle').empty %}data-anchor-nav-title="{{ pimcore_input('anchorTitle').frontend }}"{% endif %}>
  4.     {% embed 'Includes/editmode-settings.html.twig' %}
  5.         {% block additionalInfo %}
  6.             <div>
  7.                 <label>
  8.                     {{ pimcore_checkbox('titleBlockCentered') }} Center Headline?
  9.                 </label>
  10.             </div>
  11.         {% endblock %}
  12.     {% endembed %}
  13.     <div class="container container-sm">
  14.         {{ include('Includes/title-block-editable.html.twig') }}
  15.         <div class="wysiwyg-area__content wysiwyg">
  16.             {{ pimcore_wysiwyg('text') }}
  17.         </div>
  18.         {{ include('Includes/button-row.html.twig', {
  19.             ulClass: pimcore_checkbox('titleBlockCentered').checked ? 'wysiwyg-area__buttons vertical-gutter--default text-center' : null,
  20.         }) }}
  21.         {% if editmode %}
  22.             {% set thumb = 'wysiwyg-area--three-images' %}
  23.             {% set embed = 'embed-responsive-1by1' %}
  24.             {% set col = '4' %}
  25.             {% set containerSize = 'md' %}
  26.         {% else %}
  27.             {% set imageCount = 0 %}
  28.             {% if not pimcore_image('image1').empty %}
  29.                 {% set imageCount = imageCount + 1 %}
  30.             {% endif %}
  31.             {% if not pimcore_image('image2').empty %}
  32.                 {% set imageCount = imageCount + 1 %}
  33.             {% endif %}
  34.             {% if not pimcore_image('image3').empty %}
  35.                 {% set imageCount = imageCount + 1 %}
  36.             {% endif %}
  37.             {% set thumb = 'wysiwyg-area' %}
  38.             {% set embed = 'embed-responsive-9by5' %}
  39.             {% set col = '12' %}
  40.             {% set containerSize = 'sm' %}
  41.             {% if imageCount >= 3 %}
  42.                 {% set thumb = 'wysiwyg-area--three-images' %}
  43.                 {% set embed = 'embed-responsive-1by1' %}
  44.                 {% set col = '4' %}
  45.                 {% set containerSize = 'md' %}
  46.             {% elseif imageCount >= 2 %}
  47.                 {% set thumb = 'wysiwyg-area--two-images' %}
  48.                 {% set embed = 'embed-responsive-4by3' %}
  49.                 {% set col = '6' %}
  50.                 {% set containerSize = 'md' %}
  51.             {% endif %}
  52.         {% endif %}
  53.         {% if editmode or imageCount > 0 %}
  54.             {% do jsConfig().add('lightbox', true) %}
  55.             <div class="js-lightbox mt-4 mt-md-5">
  56.                 <div class="row">
  57.                     {% if editmode or not pimcore_image('image1').empty %}
  58.                         <div class="col-{{ col }}">
  59.                             {% set lightBoxSrc = not pimcore_image('image1').empty ? pimcore_image('image1').image.thumbnail('lightbox') : '' %}
  60.                             {% set description = getImageDescription(pimcore_image('image1').image) %}
  61.                             <figure class="wysiwyg-area__image">
  62.                                 <a href="{{ lightBoxSrc | default("") }}"  data-sub-html="{{ description ?: '' }}"
  63.                                    class="js-lightbox__item embed-responsive wysiwyg-area__image {{ embed }}">
  64.                                     {{ pimcore_image('image1', {
  65.                                         thumbnail: thumb,
  66.                                         imgAttributes: {
  67.                                             class: 'js-lazy-img embed-responsive-item js-fade-in'
  68.                                         },
  69.                                         lowQualityPlaceholder: true,
  70.                                     }) }}
  71.                                     {% do jsConfig().add('lazyImg', true) %}
  72.                                 </a>
  73.                                 {% if description %}
  74.                                     <figcaption>
  75.                                         {{ description }}
  76.                                     </figcaption>
  77.                                 {% endif %}
  78.                             </figure>
  79.                         </div>
  80.                     {% endif %}
  81.                     {% if editmode or not pimcore_image('image2').empty %}
  82.                         <div class="col-{{ col }}">
  83.                             {% set lightBoxSrc = not pimcore_image('image2').empty ? pimcore_image('image2').image.thumbnail('lightbox') : '' %}
  84.                             <figure class="wysiwyg-area__image">
  85.                                 {% set description = getImageDescription(pimcore_image('image2').image) %}
  86.                                 <a href="{{ lightBoxSrc | default("") }}" data-sub-html="{{ description ?: '' }}"
  87.                                    class="js-lightbox__item embed-responsive wysiwyg-area__image {{ embed }}">
  88.                                     {{ pimcore_image('image2', {
  89.                                         thumbnail: thumb,
  90.                                         imgAttributes: {
  91.                                             class: 'js-lazy-img embed-responsive-item js-fade-in'
  92.                                         },
  93.                                         lowQualityPlaceholder: true,
  94.                                     }) }}
  95.                                     {% do jsConfig().add('lazyImg', true) %}
  96.                                 </a>
  97.                                 {% if description %}
  98.                                     <figcaption>
  99.                                         {{ description }}
  100.                                     </figcaption>
  101.                                 {% endif %}
  102.                             </figure>
  103.                         </div>
  104.                     {% endif %}
  105.                     {% if editmode or not pimcore_image('image3').empty %}
  106.                         <div class="col-{{ col }}">
  107.                             {% set lightBoxSrc = not pimcore_image('image3').empty ? pimcore_image('image3').image.thumbnail('lightbox') : '' %}
  108.                             <figure class="wysiwyg-area__image">
  109.                                 {% set description = getImageDescription(pimcore_image('image3').image) %}
  110.                                 <a href="{{ lightBoxSrc | default("") }}" data-sub-html="{{ description ?: '' }}"
  111.                                    class="js-lightbox__item embed-responsive wysiwyg-area__image {{ embed }}">
  112.                                     {{ pimcore_image('image3', {
  113.                                         thumbnail: thumb,
  114.                                         imgAttributes: {
  115.                                             class: 'js-lazy-img embed-responsive-item js-fade-in'
  116.                                         },
  117.                                         lowQualityPlaceholder: true,
  118.                                     }) }}
  119.                                     {% do jsConfig().add('lazyImg', true) %}
  120.                                 </a>
  121.                                 {% if description %}
  122.                                     <figcaption>
  123.                                         {{ description }}
  124.                                     </figcaption>
  125.                                 {% endif %}
  126.                             </figure>
  127.                         </div>
  128.                     {% endif %}
  129.                 </div>
  130.             </div>
  131.         {% endif %}
  132.     </div>
  133. </section>