Entity Class Formatter
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
Overview
Entity Class Formatter is a very simple module which formats values of fields (of varying types) such that a class is placed on the parent entity of that field. The module can be used to apply classes on entities, allowing the class to act as a modifier which can be used by the theming layer.
Usage
Follow these steps
- Add a text, list or entity reference field to any entity (Node, Paragraph, Block, etc).
- Set the display to "Entity CSS" (on manage display admin page).
- Create matching CSS rules in your theme or map a Modifier using the Look module.
Supported field types
This formatter can be applied to the following field types:
- Text
- List
- Entity Reference
Supported entity types
This formatter works with all entity types
Similar Modules
The module is similar to two other modules, but differs in important ways.
The Classy Paragraphs module was intended to apply to Paragraphs only and is quite structured in the way classes are applied through a custom field type. The Entity Class Formatter module is more flexible in that it has been designed to apply to all entity types. It can also handle a variety of field types (text, select lists, entity references) and is able to adapt to the data at hand.
The Field Formatter CSS Class module also uses a field formatter approach to applying the class to the entity. It does have more complexity than this module because it deals with several layers of nesting. The Entity Class Formatter is very simple and only applies to the parent entity of the field.
GitHub
Development is happening in our GitHub repository. The drupal.org issue queue is still used to coordinate development.