url button tout voir dyamique

This commit is contained in:
2025-05-27 23:36:23 +02:00
parent 775740d312
commit 2efd679417
2 changed files with 11 additions and 2 deletions
+3
View File
@@ -223,6 +223,8 @@ function eql_preprocess_views_view_unformatted(array &$variables) {
if ($node->hasField('field_type_de_ressource') && !$node->get('field_type_de_ressource')->isEmpty()) {
foreach ($node->get('field_type_de_ressource')->referencedEntities() as $term) {
$label = $term->label();
$tid = $term->id(); // <-- on récupère l'ID
$label_ascii = $transliterator->transliterate($label);
$type_class = 'type-' . Html::cleanCssIdentifier(strtolower($label_ascii));
@@ -230,6 +232,7 @@ function eql_preprocess_views_view_unformatted(array &$variables) {
if (!isset($slides[$type_class])) {
$slides[$type_class] = [
'label' => $label,
'tid' => $term->id(),
'rows' => [],
];
}