diff --git a/web/themes/custom/popsu/popsu.theme b/web/themes/custom/popsu/popsu.theme index 39653a52..9db9f81c 100644 --- a/web/themes/custom/popsu/popsu.theme +++ b/web/themes/custom/popsu/popsu.theme @@ -68,8 +68,8 @@ function popsu_preprocess_field(&$variables){ if($element["#field_name"] == "field_programme"){ foreach ($element["#items"]->getIterator() as $id => $item) { $nid = $item->getValue()['target_id']; - $variables['items'][$id]['attributes']['class'] = new Attribute(); - $variables['items'][$id]['attributes']['class']->addClass("programme-".$nid); + $variables['items'][$nid]['attributes']['class'] = new Attribute(); + $variables['items'][$nid]['attributes']->addClass("programme-".$nid); } } }