Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I installed the module "Node class" (https://drupal.org/project/node_class).
In the README file of "Node class" I read:
"Open your node.tpl.php in your theme and add the following: print node_class($node)
".
After some searching I think the preferred place to do this for AdaptiveTheme would be in the template.php file in the root of the sub-theme so I added this:
/**
* Preprocess variables for the html template.
*/
function canister_preprocess_html(&$vars) {
$vars['classes_array'][] = node_class($node);
}
But the class of the "Node class" module doesn't show. Am I missing something? Can someone give me a push?
Thanks in advance
Comments
Comment #1
Jeff Burnz CreditAttribution: Jeff Burnz commentedLike this:
See it uses the preprocess_node function and correctly uses the $vars['node'] variable.