This commit is contained in:
armansansd
2021-10-18 13:00:56 +02:00
parent 3b008b5a74
commit dd4d9df8e5
3 changed files with 32 additions and 38 deletions

View File

@@ -42,6 +42,15 @@ function popsu_preprocess_field(&$variables){
if ($element['#field_name'] == 'field_texte') {
$variables['attributes']['class'][] = 'crop';
}
if($element["#field_name"] == "field_programme"){
foreach ($variables["items"] as $id => $item) {
$item['attributes']['class'] = new Attribute();
$c = $item['content']['#options']['entity']->nid->getString();
$item['attributes']->addClass("programme-".$c);
// kint($variables["items"]);die();
}
}
}
}