comment preprocess field
This commit is contained in:
@@ -5,6 +5,6 @@ global-css:
|
|||||||
global-js:
|
global-js:
|
||||||
js:
|
js:
|
||||||
scripts/main.js: {}
|
scripts/main.js: {}
|
||||||
dependencies:
|
# dependencies:
|
||||||
- core/jquery
|
# - core/jquery
|
||||||
|
|
||||||
|
|||||||
@@ -37,13 +37,13 @@ function eql_preprocess_node(&$variables){
|
|||||||
// $variables['elements']['#paragraph']->item_id;
|
// $variables['elements']['#paragraph']->item_id;
|
||||||
// }
|
// }
|
||||||
// la fonction suivante ne sert à rien
|
// la fonction suivante ne sert à rien
|
||||||
function eql_preprocess_field(&$variables) {
|
// function eql_preprocess_field(&$variables) {
|
||||||
|
|
||||||
$paragraph = &$variables['paragraph'];
|
// $paragraph = &$variables['paragraph'];
|
||||||
$variables['attributes']['class'][] = 'paragraph-type-' . $paragraph->id();
|
// $variables['attributes']['class'][] = 'paragraph-type-' . $paragraph->id();
|
||||||
$hook_id = $paragraph->get('paragraph-id--')->getString();
|
// $hook_id = $paragraph->get('paragraph-id--')->getString();
|
||||||
$variables['attributes']['class'][] = 'hook-id-' . $hook_id;
|
// $variables['attributes']['class'][] = 'hook-id-' . $hook_id;
|
||||||
}
|
// }
|
||||||
//might be useful for if-clause: $variables['field_name'] and $variables['field_type']
|
//might be useful for if-clause: $variables['field_name'] and $variables['field_type']
|
||||||
// if ($paragraph && $paragraph->getEntityTypeId() == 'paragraph' . $paragraph->id() ) {
|
// if ($paragraph && $paragraph->getEntityTypeId() == 'paragraph' . $paragraph->id() ) {
|
||||||
//whatever logic you need goes here, e.g. something like
|
//whatever logic you need goes here, e.g. something like
|
||||||
|
|||||||
@@ -35,14 +35,14 @@ function toggleFaq(event) {
|
|||||||
|
|
||||||
// fonction pour attribuer la class du parents
|
// fonction pour attribuer la class du parents
|
||||||
|
|
||||||
var fields = document.getElementsByClassName("field--name-field-titre");
|
// var fields = document.getElementsByClassName("field--name-field-titre");
|
||||||
var paragraphs = document.getElementsByClassName("paragraph--type--texte");
|
// var paragraphs = document.getElementsByClassName("paragraph--type--texte");
|
||||||
for (let i = 0; i < fields.length; i++) {
|
// for (let i = 0; i < fields.length; i++) {
|
||||||
const field = fields[i]
|
// const field = fields[i]
|
||||||
}
|
// }
|
||||||
function giveIdParent(){
|
// function giveIdParent(){
|
||||||
document.field.classList="paragraphs";
|
// document.field.classList="paragraphs";
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Function mouseOut ()
|
// Function mouseOut ()
|
||||||
// {
|
// {
|
||||||
|
|||||||
Reference in New Issue
Block a user