paragraph id
This commit is contained in:
@@ -31,13 +31,40 @@ function eql_preprocess_node(&$variables){
|
||||
|
||||
// counter pour id
|
||||
|
||||
// function eql_preprocess_field(&$variables) {
|
||||
// static $counter = 0;
|
||||
// $variables['counter'] = $counter++;ext
|
||||
// }
|
||||
// function eql_preprocess_field(&$variables) {
|
||||
// // static $counter = 0;
|
||||
// // $variables['counter'] = $counter++;
|
||||
// $variables['elements']['#paragraph']->item_id;
|
||||
// }
|
||||
// la fonction suivante ne sert à rien
|
||||
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;
|
||||
}
|
||||
//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
|
||||
//$variables['attributes']['data-from-parent-paragraph'] = $parentEntity->getYourStuff();
|
||||
// }
|
||||
|
||||
|
||||
// function MYTHEME_preprocess_views_view_fields__view_machine_name(&$vars) {
|
||||
// static $counter = 0;
|
||||
// $vars['counter'] = $counter++;
|
||||
// }
|
||||
|
||||
// function yourtheme_preprocess_field(&$variables, $hook) {
|
||||
// $element = $variables['element'];
|
||||
// $parentEntity = $element['#object'];
|
||||
// //might be useful for if-clause: $variables['field_name'] and $variables['field_type']
|
||||
// if ($parentEntity && $parentEntity->getEntityTypeId() == 'paragraph' ) {
|
||||
// //whatever logic you need goes here, e.g. something like
|
||||
// //$variables['attributes']['data-from-parent-paragraph'] = $parentEntity->getYourStuff();
|
||||
// }
|
||||
// }
|
||||
|
||||
// $variables['elements']['#entity']->item_id;
|
||||
|
||||
// function MYTHEME_preprocess_views_view_fields__view_machine_name(&$vars) {
|
||||
// static $counter = 0;
|
||||
// $vars['counter'] = $counter++;
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user