templates/areas/content-brick/layouts/text-image.html.twig line 1

Open in your IDE?
  1. {% set hasImage = editmode || (overrideImage ?? null) || not pimcore_image('image').isEmpty() %}
  2. {% set showReadmoreMobile = pimcore_checkbox("showReadmoreMobile").getData() %}
  3. {% set showReadmore = pimcore_checkbox("showReadmore").getData() %}
  4. {% set hideMediaOnMobile = pimcore_checkbox("hideMediaOnMobile").getData() %}
  5. {% set showRentalFormButton = pimcore_checkbox('showRentalFormButton').getData() %}
  6. {% set showRentalFormButtonColor = pimcore_select('showRentalFormButtonColor').getData() %}
  7. {% set showCustomButtonComment = pimcore_checkbox('showCustomButtonComment').getData() %}
  8. {% set customButtonComment = pimcore_input('customButtonComment').getData() %}
  9. <div class="container grid justify-center grid-cols-1 gap-6 mx-auto text-base md:text-lg md:grid-cols-2">
  10.     <div class="
  11.         md:flex md:items-center
  12.         {% if hasImage %}
  13.             {{ pimcore_select('inverted').data ? 'md:order-2 lg:pl-16'  : 'md:order-1 lg:pr-16' }}
  14.         {% else %}
  15.             col-span-1 md:col-span-2
  16.         {% endif %}
  17.         {{ hideMediaOnMobile ? 'pt-4 md:pt-0' : '' }}
  18.     "
  19.         x-data="{ contentOpen: false }"
  20.     >       
  21.         <div>
  22.             {% include 'areas/content-brick/partials/_headline.html.twig' %}
  23.             {% include 'areas/content-brick/partials/_title.html.twig' %}
  24.             <div 
  25.                 class="relative overflow-hidden"
  26.                 {% if showReadMore is defined and showReadMore %}
  27.                     :class="{'max-h-36 {{ showReadmoreMobile ? 'md:max-h-fit' : ''}}': !contentOpen }"
  28.                 {% endif %}
  29.             >
  30.                 {% include 'areas/content-brick/partials/_wysiwyg.html.twig' %}
  31.                 {% if showReadmore %}
  32.                     <div 
  33.                         class=" flex flex-col justify-end bottom-0 w-full  min-h-[100px]
  34.                         {{ showReadmoreMobile ? 'md:hidden' : ''}}"
  35.                         :class="!contentOpen ? 'absolute bg-gradient-to-t from-white via-white' : ''"     
  36.                     >
  37.                         <button 
  38.                             class="button button__secondary group"
  39.                             @click="contentOpen = !contentOpen"
  40.                         >
  41.                             <span x-show="!contentOpen">{{ 'Lees meer' | trans }}</span>
  42.                             <span x-show="contentOpen">{{ 'Lees minder' | trans }}</span>
  43.                             <span class="flex items-center justify-center w-6 h-6 ml-3 bg-white rounded-full shadow-md text-blue group-hover:bg-blue group-hover:text-white">
  44.                                 <svg
  45.                                     x-show="!contentOpen"
  46.                                     class="w-3.5 shrink-0"
  47.                                     xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><path fill="currentColor" fill-rule="nonzero" d="M6.68 0h.024a.929.929 0 0 1 .916.915l.07 4.994 4.994.07a.93.93 0 0 1 .916.916.878.878 0 0 1-.866.89h-.024l-4.995-.07.07 4.995a.878.878 0 0 1-.89.89.93.93 0 0 1-.915-.916L5.91 7.69.914 7.62A.93.93 0 0 1 0 6.704a.878.878 0 0 1 .89-.89l4.994.07L5.814.89A.878.878 0 0 1 6.68 0Z"/>
  48.                                 </svg>
  49.                                 <svg
  50.                                     x-show="contentOpen"
  51.                                     class="w-3.5 shrink-0"
  52.                                     xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 3"><path fill="currentColor" fill-rule="nonzero" d="M12.684.979a.929.929 0 0 1 .916.916.878.878 0 0 1-.866.89h-.024L.915 2.62A.929.929 0 0 1 0 1.704a.878.878 0 0 1 .89-.89l11.794.165Z"/>
  53.                                 </svg>  
  54.                             </span>
  55.                         </button>
  56.                     </div>
  57.                 {% endif %}
  58.             </div>
  59.             {% if editmode %}
  60.                 <div class="mt-8">
  61.                     <label class="block">
  62.                         {{ pimcore_checkbox('showReadmore', { reload: true }) }}
  63.                         <span>Toon 'Lees meer' button voor bovenstaande tekst.</span>
  64.                     </label>
  65.                     <label class="block">
  66.                         {{ pimcore_checkbox('showReadmoreMobile', { reload: true }) }}
  67.                         <span>Toon 'Lees meer' button alleen op mobiele devices.</span>
  68.                     </label>
  69.                 </div>
  70.             {% endif %}
  71.             {% include 'areas/content-brick/partials/_usps.html.twig' %}
  72.             {% include 'areas/content-brick/partials/_form-builder.html.twig' with {
  73.                 'fieldName' : 'formbuilder-select_text-image' }
  74.             %}
  75.             {% include 'areas/content-brick/partials/_buttons.html.twig' with {
  76.                 product: product ?? null,
  77.                 productCategory: productCategory ?? null,
  78.                 showRentalFormButton: showRentalFormButton ?? null,
  79.                 showRentalFormButtonColor: showRentalFormButtonColor ?? null,
  80.                 greenButton: true,
  81.                 showCustomButtonComment: showCustomButtonComment ?? null,
  82.                 buttonComment: customButtonComment !== '' ? customButtonComment : 'Binnen één dag vrijblijvend een offerte'|trans
  83.             } %}
  84.         </div>
  85.     </div>
  86.     {% if hasImage %}
  87.         <div class="md:flex md:items-center 
  88.             {{ pimcore_select('inverted').data ? 'md:order-1' : 'md:order-2' }}
  89.             {{ hideMediaOnMobile ? 'hidden md:block' : '' }}
  90.         ">
  91.             {% if overrideImage is defined and overrideImage and pimcore_image('image').isEmpty() %}
  92.                 {% include('areas/content-brick/partials/override-image.html.twig') %}
  93.             {% else %}
  94.                 {{ pimcore_image('image', {
  95.                     class: 'block overflow-hidden rounded-md',
  96.                     thumbnail: 'content',
  97.                     pictureAttributes: {class: 'block overflow-hidden rounded-md'}
  98.                 }) | raw }}
  99.             {% endif %}
  100.         </div>
  101.     {% endif %}
  102. </div>