Browse Source

debug node-id

ouidade 2 weeks ago
parent
commit
4e47d9fe40
1 changed files with 4 additions and 0 deletions
  1. 4 0
      web/themes/custom/eql/eql.theme

+ 4 - 0
web/themes/custom/eql/eql.theme

@@ -14,6 +14,10 @@ use Drupal\Core\Template\Attribute;
 
 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();
+  }
   if ($node instanceof NodeInterface) {
     $variables['attributes']['class'][] = 'node-type-' . $node->bundle();
     $variables['attributes']['class'][] = 'node-id-' . $node->id();