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
- Local action menu links per link route
- 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: [policy] 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.
How to use
Remember that to see Twig Template Suggester's template suggestions during development, as with all template suggestions, enable Twig debugging at Admin » Configure » Development settings (/admin/config/development/settings), and look in the page source (inspect or view source in your browser) for template name suggestions.
Project information
- Project categories: Content display, Developer tools
4,454 sites report using this module
- Created by mlncn on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.
Releases
Include block suggestion per region per bundle
Development version: 2.0.x-dev updated 23 Sep 2025 at 22:57 UTC
Template suggestions for forms, menus, and book trees
Development version: 8.x-1.x-dev updated 17 Sep 2024 at 18:16 UTC



