preprocess field typ de protegoniste

This commit is contained in:
2022-01-25 12:27:57 +01:00
parent a7ffdebc8a
commit bb95755b8b
3 changed files with 927 additions and 339 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
"name": "Listen for Xdebug", "name": "Listen for Xdebug",
"type": "php", "type": "php",
"request": "launch", "request": "launch",
"serverSourceRoot":"192.168.0.21" "serverSourceRoot":"192.168.1.40",
"port": 9001, "port": 9001,
"pathMappings": { "pathMappings": {
"/var/www/d9": "${workspaceFolder}" "/var/www/d9": "${workspaceFolder}"
File diff suppressed because one or more lines are too long
+11 -11
View File
@@ -32,17 +32,17 @@ function eql_preprocess_node(&$variables){
} }
/** /// fonctionne pour donner id au champs mais fais bugger les pages static "field unkown" function eql_preprocess_field(&$variables) {
* $node = \Drupal::routeMatch()->getParameter('node');
* Implements hook_preprocess_field().
*/ $field_name = &$variables['field_name'];
// function eql_preprocess_field(&$variables) { if($node) {
// $node = \Drupal::routeMatch()->getParameter('node'); if ($field_name == 'field_type_de_protagoniste'){
// if($node) { $type_protagoniste = $node->get('field_type_de_protagoniste')->getString();
// $type_protagoniste = $node->get('field_type_de_protagoniste')->getString(); $variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste;
// $variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste; }
// } }
// } }
////////////////////////////////////////////////// //////////////////////////////////////////////////