template_suggester
31 sites
No security coverage
This module provides a new functionality that let you be able to extends the core entity templates suggestions with other totally cutomized.
The module provides a field type named template_suggester where you can select the new customized suggestion.
It gives you the ability to display one structure display in multiple ways.
REQUIREMENTS
The core field module.
INSTALLATION
Install as you would normally install a contributed Drupal module.
CONFIGURATION
- Create template_suggester.yml in your active theme folder and add your template suggestions.
- Add Template Suggester field in to your entity.
- Add a content and select suggestion as you wish.
- Once you have a different template for your content you have no limits to customize it.
Template suggestion Logic
- ENTITY__SELECTED_SUGGESTER
- ENTITY__CURRENT_BUNDLE__SELECTED_SUGGESTER
- ENTITY__SELECTED_SUGGESTER__VIEW_MODE
- ENTITY__CURRENT_BUNDLE__SELECTED_SUGGESTER__VIEW_MODE
Example yml configuration
node: (ENTITY)
style_1: (SELECTED_SUGGESTER)
name: Visible name
bundles:
- article (CURRENT_BUNDLE)
Suggestion Output
node--style-1.html.twig
node--article--style-1.html.twig
node--style-1--full.html.twig
node--article--style-1--full.html.twig
Tested and works fine with follow entities.
- node
- taxonomy_term
- paragraph