popup fiche id site pilotes

This commit is contained in:
2025-10-03 15:32:29 +02:00
parent 65b7d93827
commit 57425b9f1f
6 changed files with 119 additions and 1 deletions
@@ -0,0 +1,32 @@
{#
/**
* @file
* Default theme implementation for a link to a file.
*
* Available variables:
* - attributes: The HTML attributes for the containing element.
* - link: A link to the file.
* - file_size: The size of the file.
* - file: L'objet fichier (si fourni).
*
* @see template_preprocess_file_link()
*
* @ingroup themeable
*/
#}
<span{{ attributes }}>
{# Si c’est une image PNG ou JPG → ajouter la classe popup-link #}
{% if file.mime == 'image/png' or file.mime == 'image/jpeg' %}
{{ link|replace({'<a ': '<a class="popup-link" '})|raw }}
{% else %}
{{ link }}
{% endif %}
</span>
{% if file_size %}
<span>({{ file_size }})</span>
{% endif %}
<div id="popup-overlay">
<span class="popup-close">&times;</span>
<img id="popup-image" src="" alt="Aperçu"/>
</div>