templates/areas/sector-cards-brick/view.html.twig line 1

Open in your IDE?
  1. {# Defined as EditableDialog field #}
  2. {% set style = style ?? pimcore_select('style').getData ?? "images" %}
  3. {# Defined as EditableDialog field #}
  4. {% set sectors = sectors ?? pimcore_relations('sectors').getElements() %}
  5. {% set clients = clients ?? pimcore_relations('clients').getElements() %}
  6. {% include 'areas/sector-cards-brick/partials/editmode/_no-objects-found.html.twig' %}
  7. {% embed 'app/area-brick-layout.html.twig' %}
  8.     {% block content %}
  9.         {% if style == 'images' and sectors|length > 0 %}
  10.             <!-- Branches 4 columns -->
  11.             <section class="{{ containerClasses ?? 'relative py-10' }} {{ defaultBackgroundColor ?? "" }}">
  12.                 {% if disableBackground is not defined or not disableBackground %}
  13.                     <div class="absolute w-full h-40 z-10 bg-white md:bg-blue-300
  14.                         {{ defaultSecondBackgroundColor ?? "md:bg-blue-200" }}
  15.                         {{ defaultSecondBackgroundPosition ?? "top-0" }}
  16.                     ">
  17.                         <!-- empty -->
  18.                     </div>
  19.                 {% endif %}
  20.                 <div class="container relative z-20">
  21.                     <div class="grid grid-cols-12 gap-8">
  22.                         {% for sector in sectors %}
  23.                             {% set page = sector.page() %}
  24.                             <a href="{{ page ? (page.url | trimUrl) : '' }}" class="col-span-12 md:col-span-6 lg:col-span-3 group">
  25.                                 <div class="relative hidden overflow-hidden rounded-md md:block">
  26.                                     {% set image = sector.visuals.current() %}
  27.                                     {% if image %}
  28.                                         {{ image.getThumbnail('sector-card').html({
  29.                                             pictureAttributes: {class: ''},
  30.                                             imgAttributes: {class: 'w-full'},
  31.                                         })|raw }}
  32.                                     {% endif %}
  33.                                     {% set icon = sector.icon() %}
  34.                                     {% if icon %}
  35.                                         <span class="absolute left-6 bottom-6">
  36.                                             {{ icon.getThumbnail('text-and-link-icon').html({
  37.                                                 pictureAttributes: {class: 'rounded-full '},
  38.                                                 imgAttributes: {class: 'w-full h-full'},
  39.                                             })|raw }}
  40.                                         </span>
  41.                                     {% endif %}
  42.                                 </div>
  43.                                 <div class="flex items-center justify-between md:mt-4">
  44.                                     {% set icon = sector.icon() %}
  45.                                     {% if icon %}
  46.                                         <span class="mr-2.5 md:hidden">
  47.                                             {{ icon.getThumbnail('text-and-link-icon').html({
  48.                                                 pictureAttributes: {class: 'rounded-full '},
  49.                                                 imgAttributes: {class: 'w-full h-full'},
  50.                                             })|raw }}
  51.                                         </span>
  52.                                     {% endif %}
  53.                                     {% if disableBackground is defined and disableBackground %}
  54.                                         {% set classes = "text-blue" %}
  55.                                     {% else %}
  56.                                         {% set classes = (defaultSecondBackgroundColor ?? null) === 'bg-blue-300' ? "text-blue md:text-white" : "text-blue md:text-white" %}
  57.                                     {% endif %}
  58.                                     <h3 class="grow text-lg font-bold {{ classes }}">{{ sector.branchename }}</h3>
  59.                                     <span
  60.                                         class="flex items-center justify-center w-6 h-6 bg-white rounded-full shadow-md text-blue group-hover:bg-blue group-hover:text-white">
  61.                                         <svg class="h-3.5 w-3.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
  62.                                             <path fill="currentColor" fill-rule="currentColor"
  63.                                                   d="m6.406 15.656 6.963-6.731c.249-.24.389-.575.389-.925 0-.35-.14-.685-.389-.925L6.406.343A1.206 1.206 0 0 0 4.657.41l-.09.113a1.297 1.297 0 0 0 .154 1.67L10.731 8l-6.008 5.806a1.295 1.295 0 0 0-.065 1.783c.463.52 1.248.55 1.748.066Z"></path>
  64.                                         </svg>
  65.                                     </span>
  66.                                 </div>
  67.                             </a>
  68.                         {% endfor %}
  69.                     </div>
  70.                 </div>
  71.             </section>
  72.         {% elseif style == 'icons' and sectors|length > 0 %}
  73.             <section class="py-8 bg-blue-200 md:py-20">
  74.                 <div class="container">
  75.                     {% if clients|default(null) %}
  76.                         <section>
  77.                             {% for client in clients %}
  78.                                 <div class="grid grid-cols-12 lg:gap-6 swiper-slide">
  79.                                     <div class="col-span-12 xl:col-start-2 xl:row-start-1 xl:col-span-6">
  80.                                         {% if client.media.items[0] is defined and client.media.items[0] is not null %}
  81.                                             {{ client.media.items[0].thumbnail('testimonial-large').html(
  82.                                                 {
  83.                                                     'pictureAttributes': {
  84.                                                     'class': 'inline-block overflow-hidden shadow-lg sm:rounded-md w-full',
  85.                                                 },
  86.                                                     'imgAttributes': {
  87.                                                     'class': 'object-cover object-center w-full h-full'
  88.                                                 },
  89.                                                 }
  90.                                             )|raw }}
  91.                                         {% endif %}
  92.                                     </div>
  93.                                     <div class="col-span-12 xl:col-span-6 xl:col-start-6 xl:row-start-1 flex items-center">
  94.                                         {% include 'areas/testimonial-brick/partials/editmode/_no-client-details-found.html.twig' %}
  95.                                         <div class="relative md:mx-6 -mt-12 lg:mt-10">
  96.                                             <div class="block p-8 text-white bg-blue-500 md:rounded shadow-lg ">
  97.                                                 <blockquote class="mb-8 text-xl font-bold leading-8 md:text-2xl">
  98.                                                     {% if client.story %}
  99.                                                         “{{ client.story }}”
  100.                                                     {% endif %}
  101.                                                 </blockquote>
  102.                                                 <span class="font-bold">
  103.                                         {% if client.job_title and client.contact %}
  104.                                             {{ client.contact }}, {{ client.job_title }}
  105.                                         {% elseif client.contact %}
  106.                                             {{ client.contact }}
  107.                                         {% endif %}
  108.                                     </span>
  109.                                             </div>
  110.                                             {% if client.logo %}
  111.                                                 <span class="flex justify-center py-6">
  112.                                         {{ client.logo.thumbnail('testimonial-small').html({
  113.                                             pictureAttributes: {class: 'p-6 rounded flex justify-center cursor-pointer bg-white !w-[188px] h-[60px] swiper-slide'},
  114.                                         }) | raw }}
  115.                                     </span>
  116.                                             {% endif %}
  117.                                             {% if document.getProperty('clientArchivePage') %}
  118.                                                 <a
  119.                                                     class="button button__secondary button__secondary--white button--no-l-padding group"
  120.                                                     href="{{ document.getProperty('clientArchivePage').url | trimUrl }}"
  121.                                                 >
  122.                                         <span
  123.                                             class="flex items-center justify-center w-6 h-6 ml-3 transition-all bg-white rounded-full shadow-md text-blue group-hover:bg-blue group-hover:text-white">
  124.                                             <svg class="h-3.5 w-3.5"
  125.                                                  xmlns="http://www.w3.org/2000/svg"
  126.                                                  viewBox="0 0 16 16">
  127.                                                 <path fill="currentColor" fill-rule="currentColor"
  128.                                                       d="m6.406 15.656 6.963-6.731c.249-.24.389-.575.389-.925 0-.35-.14-.685-.389-.925L6.406.343A1.206 1.206 0 0 0 4.657.41l-.09.113a1.297 1.297 0 0 0 .154 1.67L10.731 8l-6.008 5.806a1.295 1.295 0 0 0-.065 1.783c.463.52 1.248.55 1.748.066Z"/>
  129.                                             </svg>
  130.                                         </span>
  131.                                                     {{ "Bekijk alle verhalen"|trans }}
  132.                                                 </a>
  133.                                             {% endif %}
  134.                                         </div>
  135.                                     </div>
  136.                                 </div>
  137.                             {% endfor %}
  138.                         </section>
  139.                     {% endif %}
  140.                     {% if editmode %}
  141.                         {% if showArchiveLink is not defined %}
  142.                             <label>
  143.                                 {{ pimcore_checkbox('showArchiveLink', { reload: true }) }}
  144.                                 <span>Toon link naar overzichtspagina</span>
  145.                             </label>
  146.                         {% endif %}
  147.                     {% endif %}
  148.                     <div class="grid grid-cols-2 gap-6 font-bold text-center md:grid-cols-3 lg:grid-cols-4">
  149.                         {% for sector in sectors %}
  150.                             {% set page = sector.page() %}
  151.                             <a href="{{ page ? (page.url | trimUrl) : '' }}"
  152.                                class="flex flex-col items-center justify-between pt-8 pb-6 transition-transform bg-white rounded-md px-7 hover:scale-105 hover:drop-shadow-2xl hover:text-blue">
  153.                                 {% if sector.icon %}
  154.                                     {{ sector.icon.getThumbnail('sector-card-icon').html({
  155.                                         pictureAttributes: {class: 'inline mb-4 rounded-full '},
  156.                                         imgAttributes: {class: 'w-full h-full'},
  157.                                     })|raw }}
  158.                                 {% endif %}
  159.                                 <span>{{ sector.branchename }}</span>
  160.                             </a>
  161.                         {% endfor %}
  162.                         {% if showArchiveLink ?? pimcore_checkbox('showArchiveLink').isChecked() %}
  163.                             <a
  164.                                 href="{{ document.getProperty('sectorArchivePage').url | trimUrl }}"
  165.                                 class="flex flex-col items-center pt-8 pb-6 text-white transition-transform rounded-md px-7 justify-evenly bg-blue hover:scale-105 hover:drop-shadow-2xl"
  166.                             >
  167.                                 <svg class="inline w-8 h-8 mb-3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
  168.                                     <path fill="currentColor" fill-rule="evenodd"
  169.                                           d="M3.5 9a3.5 3.5 0 0 1 .192 6.995L3.5 16a3.5 3.5 0 0 1-.192-6.995L3.5 9Zm9 0a3.5 3.5 0 0 1 .192 6.995L12.5 16a3.5 3.5 0 0 1-.192-6.995L12.5 9Zm-9 1.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm9 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4ZM3.5 0a3.5 3.5 0 0 1 .192 6.995L3.5 7A3.5 3.5 0 0 1 3.308.005L3.5 0Zm9 0a3.5 3.5 0 0 1 .192 6.995L12.5 7a3.5 3.5 0 0 1-.192-6.995L12.5 0Zm-9 1.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm9 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z"/>
  170.                                 </svg>
  171.                                 <span>{{ 'Bekijk alles' | trans }}</span>
  172.                             </a>
  173.                         {% endif %}
  174.                     </div>
  175.                 </div>
  176.             </section>
  177.         {% endif %}
  178.     {% endblock %}
  179. {% endembed %}