templates/includes/cards/reference.html.twig line 1

Open in your IDE?
  1. {% set isMirrored = false %}
  2. {% if mirrored|default() %}
  3.     {% set isMirrored = true %}
  4. {% endif %}
  5. {% set standalone = false %}
  6. {% if project | default() %}
  7.     {% set title = project.getReferenceTitle() | default() %}
  8.     {% set description = project.getReferenceDescription() | default() %}
  9.     {% set subtitle = project.getImageSubtitle() | default() %}
  10.     {% set image = project.visuals.current() %}
  11.     {% set sector = project.sectors | first %}
  12.     {% if (sector) %}
  13.         {% set icon = sector.icon %}
  14.     {% else %}
  15.         {% set icon = null %}
  16.     {% endif %}
  17.     {% set usp_title = project.getUspTitle() | default() %}
  18.     {% set contact_link = project.getCtaLink() | default() %}
  19.     {% set contact_image = project.getCtaImage() | default() %}
  20.     {% set usp_items = project.getUspItems() | default() %}
  21. {% else %}
  22.     {% if pimcore_relation('relatedProject').isEmpty() %}
  23.         <p>no project linked</p>
  24.     {% else %}
  25.         {% set title = pimcore_relation('relatedProject').getData().getReferenceTitle() | default() %}
  26.         {% set description = pimcore_relation('relatedProject').getData().getReferenceDescription() | default() %}
  27.         {% set subtitle = pimcore_relation('relatedProject').getData().getImageSubtitle() | default() %}
  28.         {% if pimcore_relation('relatedProject').getData().sectors | default() %}
  29.             {% set sector = pimcore_relation('relatedProject').getData().sectors | first %}
  30.             {% if (sector) %}
  31.                 {% set icon = sector.icon %}
  32.             {% else %}
  33.                 {% set icon = null %}
  34.             {% endif %}
  35.         {% endif %}
  36.         {% if pimcore_relation('relatedProject').getData().visuals | default() %}
  37.             {% set image = pimcore_relation('relatedProject').getData().visuals.current() %}
  38.         {% endif %}
  39.         {% set usp_title = pimcore_relation('relatedProject').getData().getUspTitle() | default() %}
  40.         {% set contact_link = pimcore_relation('relatedProject').getData().getCtaLink() | default() %}
  41.         {% set contact_image = pimcore_relation('relatedProject').getData().getCtaImage() | default() %}
  42.         {% set usp_items = pimcore_relation('relatedProject').getData().getUspItems() | default() %}
  43.         {% set standalone = true %}
  44.     {% endif %}
  45. {% endif %}
  46. {% if standalone %}
  47.     <div class="container">
  48. {% endif %}
  49. <div
  50.     class="flex w-full block col-span-12 items-center relative {% if isMirrored %} md:flex-row-reverse {% else %} md:flex-row {% endif %} flex-col-reverse {{ class ?? '' }}">
  51.     <div class="w-full md:w-[57%] bg-white px-8 py-6 md:p-10 flex flex-col items-start md:rounded">
  52.         {% include 'includes/cards/partials/label.html.twig' with {
  53.             label: 'Projectreferentie' | trans
  54.         } %}
  55.         {% if title %}
  56.             <h2 class="mt-4">{{ title }}</h2>
  57.         {% endif %}
  58.         {% if description %}
  59.             <p>{{ description | raw }}</p>
  60.         {% endif %}
  61.         {% if usp_title %}
  62.             <h3 class="mt-4 mb-6">{{ usp_title }}</h3>
  63.         {% endif %}
  64.         {% if usp_items %}
  65.             <div class="flex flex-col gap-8">
  66.                 {% for item in usp_items %}
  67.                     <div class="flex flex-row gap-4">
  68.                         {% set itemIcon = item.uspItemIcon.getData() | default() %}
  69.                         {% set itemTitle = item.uspItemTitle.getData() | default() %}
  70.                         {% set itemDescription = item.uspItemDescription.getData() | default() %}
  71.                         {% if itemIcon %}
  72.                             <img class="w-[54px] h-[54px]" src="{{ itemIcon.getThumbnail('sector-card-usp') }}" alt="">
  73.                         {% endif %}
  74.                         <div>
  75.                             {% if itemTitle %}
  76.                                 <h4>{{ itemTitle }}</h4>
  77.                             {% endif %}
  78.                             {% if itemDescription %}
  79.                                 <p>{{ itemDescription }}</p>
  80.                             {% endif %}
  81.                         </div>
  82.                     </div>
  83.                 {% endfor %}
  84.             </div>
  85.         {% endif %}
  86.         {% if contact_link %}
  87.             <a href="{{ contact_link.href() }}" class="flex flex-row gap-4 w-full md:max-w-max mt-6 py-4 px-4 md:pl-8 md:pr-16 bg-blue-300 text-white rounded hover:bg-blue-500 transition-all duration-100">
  88.                 {% if contact_image %}
  89.                     {{ contact_image.getThumbnail('sector-card-cta').html({
  90.                         imgAttributes: {class: 'rounded-full overflow-hidden'},
  91.                     }) | raw }}
  92.                 {% endif %}
  93.                 <div>
  94.                     <h4 class="text-[20px]">{{ contact_link.getText() }}</h4>
  95.                     <div class="mt-4 md:mt-0 flex flex-row">
  96.                         <b>{{ 'project.reference_button' | trans }}</b>
  97.                         <span
  98.                             class="flex items-center justify-center shadow w-7 h-7 ml-3 transition-all bg-white rounded-full text-blue">
  99.                             <svg class="rotate-180 relative left-[1px]" width="0.85em" height="0.85em" fill="#0072BB"
  100.                                  viewBox="0 0 10 16" xmlns="http://www.w3.org/2000/svg">
  101.                                 <path fill-rule="evenodd"
  102.                                       d="M7.685.344.722 7.075C.474 7.315.333 7.65.333 8c0 .35.14.685.389.925l6.963 6.732a1.206 1.206 0 0 0 1.749-.068l.09-.113a1.297 1.297 0 0 0-.154-1.67L3.36 8 9.37 2.193A1.295 1.295 0 0 0 9.434.41 1.205 1.205 0 0 0 7.685.344Z"></path></svg>
  103.                     </span>
  104.                     </div>
  105.                 </div>
  106.             </a>
  107.         {% endif %}
  108.     </div>
  109.     <div class="w-full md:w-[43%] bg-blue-200">
  110.         {% if isMirrored %}
  111.             {% set pictureClass = 'block overflow-hidden rounded-l' %}
  112.         {% else %}
  113.             {% set pictureClass = 'block overflow-hidden rounded-r' %}
  114.         {% endif %}
  115.         <div class="relative">
  116.             {% if image | default() %}
  117.                 {{ image.getThumbnail('project-card-1-1').html({
  118.                     pictureAttributes: {class: pictureClass},
  119.                     imgAttributes: {class: 'w-full'},
  120.                 })|raw }}
  121.             {% endif %}
  122.             {% if sector | default() %}
  123.                 {% include 'includes/cards/partials/label.html.twig' with {
  124.                     label: sector.branchename,
  125.                     labelIcon: icon,
  126.                     position: 'absolute top-6 right-6'
  127.                 } %}
  128.             {% endif %}
  129.         </div>
  130.         <div class="flex {% if isMirrored %} justify-end {% endif %}">
  131.             <div
  132.                 class="bg-gray-100 px-6 py-4 w-full md:w-[90%] {% if isMirrored %} md:rounded-bl {% else %} md:rounded-br {% endif %}">
  133.                 {{ subtitle }}
  134.             </div>
  135.         </div>
  136.     </div>
  137. </div>
  138. {% if standalone %}
  139.     </div>
  140. {% endif %}