12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- /*
- * @files
- * Theme Template Funtions
- */
- function eql_preprocess_html(&$variables) {
- $node = \Drupal::routeMatch()->getParameter('node');
- if ($node){
- $variables['attributes']['class'][] = 'node-type-' . $node->bundle();
- $variables['attributes']['class'][] = 'node-id-' . $node->id();
- }
- }
- function eql_preprocess_node(&$variables){
- $node = &$variables['node'];
- $variables['attributes']['class'][] = 'node-type-' . $node->gettype();
- if($node->gettype() == "actualite") {
- $actu_type = $node->get('field_actu_type')->getString();
- $variables['attributes']['class'][] = 'actu-type-' . $actu_type;
- }
- }
- variables) {
- counter = 0;
- variables['counter'] = $counter++;
- variables['elements']['#paragraph']->item_id;
-
- 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;
- variables['field_name'] and $variables['field_type']
- paragraph && $paragraph->getEntityTypeId() == 'paragraph' . $paragraph->id() ) {
-
- variables['attributes']['data-from-parent-paragraph'] = $parentEntity->getYourStuff();
-
- variables, $hook) {
- element = $variables['element'];
- parentEntity = $element['#object'];
- variables['field_name'] and $variables['field_type']
- parentEntity && $parentEntity->getEntityTypeId() == 'paragraph' ) {
-
- variables['attributes']['data-from-parent-paragraph'] = $parentEntity->getYourStuff();
-
- variables['elements']['#entity']->item_id;
- vars) {
- counter = 0;
- vars['counter'] = $counter++;
-
|