Kind of similar to my previous question, but apparently doesn't work the same way: is there an easy way to use a taxonomy term or a token as node css class to theme different pages?


Edit you node-type.tpl.php for this.

    foreach($node->taxonomy as $term){
            $term_classes[] = $term->name;

And print those classes in your node content wrapper.

<div class="content <?php print implode(' ', $term_classes); ?>">
    <?php print $content ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.