templates/articles/blocks/show-contact-info.html.twig line 1

Open in your IDE?
  1. {% if content_adresse is defined and content_adresse is not empty and content_adresse|length > 0 %}
  2.     {% set class = '' %}
  3.     {% if classCSS is defined and classCSS is not empty %}
  4.         {% set class = classCSS %}
  5.     {% endif %}
  6.     <div>
  7.         {% if title is defined and title is not empty and title|length > 0 %}
  8.             <div class="fw600{{class}}">{{title|raw}}</div>
  9.         {% endif %}
  10.         {{content_adresse[0]}}
  11.     </div>
  12. {% endif %}
  13. {% if content_phone is defined and content_phone is not empty and (content|length) > 0 %}
  14.     <div class="mb-1em">
  15.         {% if content_phone starts with '+33' %}
  16.             {% set formatted_content_phone = (content_phone|slice(0, 3)) ~ ' ' ~ (content_phone|slice(3, 1)) ~ ' ' ~ (content_phone|slice(4, 2)) ~ ' ' ~ (content_phone|slice(6, 2)) ~ ' ' ~ (content_phone|slice(8, 2)) %}
  17.         {% elseif content_phone starts with '0' %}
  18.             {% set formatted_content_phone = (content_phone|slice(0, 2)) ~ ' ' ~ (content_phone|slice(2, 2)) ~ ' ' ~ (content_phone|slice(4, 2)) ~ ' ' ~ (content_phone|slice(6, 2)) ~ ' ' ~ (content_phone|slice(8, 2)) %}
  19.         {% else %}
  20.             {% set formatted_content_phone = content_phone %}
  21.             {# Retourne tel quel si format non reconnu #}
  22.         {% endif %}
  23.         Tél.
  24.         {{ formatted_content_phone }}
  25.     </div>
  26. {% endif %}
  27. {% if content_email is defined and content_email is not empty %}
  28.     <div class="mb-1em">
  29.         <a href="mailto:{{content_email|raw}}">{{ content_email|raw}}</a>
  30.     </div>
  31. {% endif %}
  32. {% if content_link is defined and content_link is not empty and content_link|length > 0 %}
  33.     <div class="mb-1em">
  34.         <a class="CTA nodeco fw500 diblock" href="{{content_link}}" target="_blank">Site web</a>
  35.     </div>
  36. {% endif %}
  37. {% if content_other_link is defined and content_other_link is not empty and content_other_link|length > 0 %}
  38.     <div class="mb-1em">
  39.         <a class="CTA nodeco fw500 diblock" href="{{content_other_link}}" target="_blank">Autre lien</a>
  40.     </div>
  41. {% endif %}
  42. {% if content_other_file is defined and content_other_file is not empty and content_other_file|length > 0 %}
  43.     <div class="mb-1em">
  44.         <a class="CTA nodeco fw500 diflex aic" href="{{content_other_file.url}}">
  45.             <svg width="14" height="17" viewbox="0 0 14 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="mr-0p5em">
  46.                 <path fill-rule="evenodd" clip-rule="evenodd" d="M0 15.3164C-2.41411e-08 14.7641 0.447715 14.3164 1 14.3164H13C13.5523 14.3164 14 14.7641 14 15.3164C14 15.8687 13.5523 16.3164 13 16.3164H1C0.447715 16.3164 2.41411e-08 15.8687 0 15.3164ZM3.29289 7.6093C3.68342 7.21877 4.31658 7.21877 4.70711 7.6093L6 8.90219L6 1.31641C6 0.764122 6.44771 0.316406 7 0.316406C7.55228 0.316406 8 0.764121 8 1.31641L8 8.90219L9.29289 7.6093C9.68342 7.21877 10.3166 7.21877 10.7071 7.6093C11.0976 7.99982 11.0976 8.63299 10.7071 9.02351L7.70711 12.0235C7.51957 12.211 7.26522 12.3164 7 12.3164C6.73478 12.3164 6.48043 12.211 6.29289 12.0235L3.29289 9.02351C2.90237 8.63299 2.90237 7.99982 3.29289 7.6093Z" fill="white"></path>
  47.             </svg>
  48.             {{' '}}Téléchargez le fichier associé
  49.         </a>
  50.     </div>
  51. {% endif %}