limited artiste list if less than 3 people on tableau list view mode
This commit is contained in:
@@ -151,6 +151,16 @@ function leshed_preprocess_node(&$variables) {
|
|||||||
$variables["attributes"]['class'][] = "has-image";
|
$variables["attributes"]['class'][] = "has-image";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tableau liste (projet) : les « Artiste(s) invité(s) » ne s'affichent que
|
||||||
|
// si la liste est courte (3 valeurs ou moins) — au-delà elle alourdit les
|
||||||
|
// listes sans rien apporter à la lecture.
|
||||||
|
if ($node_type === 'projet' && $variables['view_mode'] === 'tableau_liste') {
|
||||||
|
$artistes = $node->get('field_artiste_s_invite_s');
|
||||||
|
if ($artistes && count($artistes) > 3) {
|
||||||
|
unset($variables['content']['field_artiste_s_invite_s']);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user