Issue #3454274 by markconroy, Lillian Bozeman: Do not override class in preprocess_field hook

merge-requests/8674/head
Alex Pott 2024-07-11 11:51:54 +01:00
parent 32a59501a9
commit 238082ab82
No known key found for this signature in database
GPG Key ID: BDA67E7EE836E5CE
1 changed files with 2 additions and 2 deletions

View File

@ -39,10 +39,10 @@ function umami_preprocess_field(&$variables, $hook) {
$element['#field_name'] == 'field_recipe_category' ||
$element['#field_name'] == 'field_tags' ||
$element['#field_name'] == 'field_difficulty') {
$variables['attributes']['class'] = 'label-items';
$variables['attributes']['class'][] = 'label-items';
if ($element['#view_mode'] == 'card' && $element['#field_name'] == 'field_difficulty') {
$variables['attributes']['class'] = 'umami-card__label-items';
$variables['attributes']['class'][] = 'umami-card__label-items';
}
}
}