Module Description
This module provides template suggestions for everything that Drupal doesn't. So far:
* Block templates per region
* Block templates per bundle (for custom/content blocks)
* Block templates per provider (and if different from provider, base plugin)
* HTML templates per node type
* Page templates per node type
* User templates per highest role|uid (and view mode)
* Field templates per view mode (and bundle)
* Book tree templates per region
* Form templates per form ID
* Form templates per region
* Form templates per region and form ID
* Menu templates per menu name
* Menu templates per region
* Menu templates per region and menu name
* Taxonomy term templates per view mode (and bundle)
* Fix entity-specific layout templates (workaround #2881195: Duplicate template suggestions/#2831144: Bundle / field name / view mode theme suggestions can conflict)
* Container templates per type, view, if it wraps a managed file element, and whether it has a parent or not (Drupal core provides no suggestions for container templates).
In addition, it makes the {{ base_path }} variable available to all templates.
Other modules already cover some template suggestion use cases quite well. In those cases, use the other modules:
* For block templates per block type, use Block Type Templates.
* For form elements per element type and form ID, use Themable forms.
* For node templates selected by content editors on a per-node basis, see Template Whisperer.
Please make your own suggestions or requests!
This is a utility module for theme developers.
It is particularly useful for "Drupal as a Service" platforms that allow twig templates but not custom code.
To add classes to existing templates, see Class It Up.
This module also serves as an example when you want to take just one or two of these template suggestions into your own theme or module, but not all of them. See Examples project for examples of pretty much everything else.
* Block templates per region
* Block templates per bundle (for custom/content blocks)
* Block templates per provider (and if different from provider, base plugin)
* HTML templates per node type
* Page templates per node type
* User templates per highest role|uid (and view mode)
* Field templates per view mode (and bundle)
* Book tree templates per region
* Form templates per form ID
* Form templates per region
* Form templates per region and form ID
* Menu templates per menu name
* Menu templates per region
* Menu templates per region and menu name
* Taxonomy term templates per view mode (and bundle)
* Fix entity-specific layout templates (workaround #2881195: Duplicate template suggestions/#2831144: Bundle / field name / view mode theme suggestions can conflict)
* Container templates per type, view, if it wraps a managed file element, and whether it has a parent or not (Drupal core provides no suggestions for container templates).
In addition, it makes the {{ base_path }} variable available to all templates.
Other modules already cover some template suggestion use cases quite well. In those cases, use the other modules:
* For block templates per block type, use Block Type Templates.
* For form elements per element type and form ID, use Themable forms.
* For node templates selected by content editors on a per-node basis, see Template Whisperer.
Please make your own suggestions or requests!
This is a utility module for theme developers.
It is particularly useful for "Drupal as a Service" platforms that allow twig templates but not custom code.
To add classes to existing templates, see Class It Up.
This module also serves as an example when you want to take just one or two of these template suggestions into your own theme or module, but not all of them. See Examples project for examples of pretty much everything else.
Module Link
Project Usage
2306
Security Covered
Covered By Security Advisory
Version Available
Production
Module Summary
This module provides template suggestions for various Drupal components, allowing theme developers to customize their themes without custom code.
Data Name
twigsuggest