Loading custom_body_class.info.yml +1 −0 Original line number Diff line number Diff line Loading @@ -2,3 +2,4 @@ type: module name : Custom body class description : Adds custom class/es core : 8.x core_version_requirement: ^8 || ^9 No newline at end of file custom_body_class.module +1 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ function custom_body_class_preprocess_html(&$variables) { if (!empty($specific_node_class) && ($specific_node_class->getValue() !== NULL) && ($specific_node_class->getValue()['value'] == 1)) { $variables['attributes']['class'][] = $node->gettype(); } $type = \Drupal::service('entity.manager')->getStorage('node_type')->load($node->getType()); $type = \Drupal::entityTypeManager()->getStorage('node_type')->load($node->getType()); $classes = $type->getThirdPartySetting('node_type_class', 'classes', ''); $variables['attributes']['class'][] = $classes; } Loading Loading
custom_body_class.info.yml +1 −0 Original line number Diff line number Diff line Loading @@ -2,3 +2,4 @@ type: module name : Custom body class description : Adds custom class/es core : 8.x core_version_requirement: ^8 || ^9 No newline at end of file
custom_body_class.module +1 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ function custom_body_class_preprocess_html(&$variables) { if (!empty($specific_node_class) && ($specific_node_class->getValue() !== NULL) && ($specific_node_class->getValue()['value'] == 1)) { $variables['attributes']['class'][] = $node->gettype(); } $type = \Drupal::service('entity.manager')->getStorage('node_type')->load($node->getType()); $type = \Drupal::entityTypeManager()->getStorage('node_type')->load($node->getType()); $classes = $type->getThirdPartySetting('node_type_class', 'classes', ''); $variables['attributes']['class'][] = $classes; } Loading