comment preprocess field

This commit is contained in:
2021-12-10 17:39:07 +01:00
parent 5cf232a542
commit 4d73b2e00b
3 changed files with 16 additions and 16 deletions
+6 -6
View File
@@ -37,13 +37,13 @@ function eql_preprocess_node(&$variables){
// $variables['elements']['#paragraph']->item_id;
// }
// la fonction suivante ne sert à rien
function eql_preprocess_field(&$variables) {
// function eql_preprocess_field(&$variables) {
$paragraph = &$variables['paragraph'];
$variables['attributes']['class'][] = 'paragraph-type-' . $paragraph->id();
$hook_id = $paragraph->get('paragraph-id--')->getString();
$variables['attributes']['class'][] = 'hook-id-' . $hook_id;
}
// $paragraph = &$variables['paragraph'];
// $variables['attributes']['class'][] = 'paragraph-type-' . $paragraph->id();
// $hook_id = $paragraph->get('paragraph-id--')->getString();
// $variables['attributes']['class'][] = 'hook-id-' . $hook_id;
// }
//might be useful for if-clause: $variables['field_name'] and $variables['field_type']
// if ($paragraph && $paragraph->getEntityTypeId() == 'paragraph' . $paragraph->id() ) {
//whatever logic you need goes here, e.g. something like