Term body class

Categories

Component ID

2409019

Component name

Term body class

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

379

Component created

Component changed

Component body

Synopsis

This modules allows addition of values of taxonomy type fields of an entity as classes in the body element, on the entity's page. It adds the settings per field instance, hence you can enable body classes for individual fields per entity type and not for a field in all entity types.

How it works -
* on the 'taxonomy term reference' field settings form page, a new checkbox is available that allows adding its values as body classes
* this setting is saved only for this field instance
* on an entity page, before rendering the html, the module will fetch all fields associated with the entity, which have been enabled as body classes, convert all their values that are associated with the node to machine names(with hyphens instead of underscore) and add to the body classes list

Currently available only for nodes and users.

Roadmap

This module is not a very complex module(yet) though in future if we find some limitations in it as per some use cases then I'll be extending the module. But for now, it's fairly simple and generally an add-on module for themers.

Pledges

I pledge to have a D8 release for my module.