Generic Templates
Generic Template injects simple, generic classes into entity Views and Forms and forwards more power over layouting and styling to css.
The generic styles are $entity_type, $bundle and $view_mode of each entity. (could be use defined, using tokens)
With enough differentiation it's possible to fallback to one generic twig template to use for all entities and no matter what bundle or view_mode they are shown and still achieve rich, visual variations using pure css.
Before css grid, such approach would not have been possible because traditional grid systems where integrative with the HTML structure: Different layouts for different view_modes required different HTML, hence different twig templates.
Simple css examples:
node.full {
# css fopr every node in full view_mode
}
node.article .field {
# css for evey field in an article-node
}
.entity-reference > .teaser:not(.article) {
# css for every teaser within an entity-reference container. Article teasers are excluded
}
Features
Here, answer the following questions: What is the basic functionality? What unique features does enabling this project add? When and why would someone use this module? What use cases are there?
Post-Installation
How does this module actually work once I install it? Should I go to a config page? Should I look for a new content type? Should I go and manage my text formats? Provide an overview of the configuration process and any other special considerations for the module.
Additional Requirements
Does this project need anything beyond Drupal core? Include any dependent modules, libraries, APIs, etc., that are required for this project to work.
Recommended modules/libraries
Are there any projects that enhance or improve the functionality of this project?
Similar projects
If there are modules providing similar functionality, please describe what differentiates them.
Supporting this Module
If you have a Patreon, OpenCollective, etc. you can put links here to describe how people can support development.
Community Documentation
A great place to add links to YouTube walkthroughs, external documentation, or a demo site (use DrupalPod!).
You may continue to put additional information below here, if there are other things you think people need to know about your module!
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Release date | |
|---|---|---|---|---|
| 1.0.x-dev | Dev | Sep 30, 2023 |