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.
Hello,
please,
anyone can help me for add a body class based on vocabulary id ?
by advance, Thx
Comments
Comment #1
jeremycaldwell CreditAttribution: jeremycaldwell commentedThe body class for taxonomies should already be added and available.
Example: page-taxonomy-term-28
The term ID is 28 for that particular taxonomy term so that is what you would use to style that particular taxonomy term.
Comment #2
plsk CreditAttribution: plsk commentedeternalistic , thanks for your reply.
But i'm need to add body class based on vocabulary id, it's possible ?
by advance, Thx
Comment #3
jeremycaldwell CreditAttribution: jeremycaldwell commentedThat's what I was trying to explain, sorry. The taxonomy, or vocabulary, id is available in the body class.
This body class appears when you are viewing a taxonomy term listing page. Such as when you add a term to a node, then click that node as it links to the taxonomy term listing page for that term. So this body class appears on that listing page but not on the page for the node that contains the taxonomy term.
Comment #4
petrovnn CreditAttribution: petrovnn commentedeternalistic, i am sorry, but you're wrong :)
Vocabulary ID
and
Term ID is different!
we need a class like: page-taxonomy-vocab-2
I know that it's not in the core now, but am looking for a universal solution