Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Generic Templates

No security coverage Maintenance fixes only

This module adds generic CSS classes to Drupal entities in views and forms, allowing for extensive layout and styling control through CSS alone. It enables the creation of distinct visual variations for any entity, bundle, or view mode using a single Twig template.

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.

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!

Ask your assistant about Generic Templates

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

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

Tracked releases
1
Tracked since
Sep 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.0.x-dev Dev 9–11 Sep 30, 2023