Part of the Entity ecosystem · 308 projects
This module allows you to theme any content entity, like nodes or custom blocks, by providing an administrative interface to edit Twig templates. It automatically makes field data available in templates and supports specifying templates based on display mode and theme.
This module is for theme entity with editable twig template in admin ui, supoorts all content entity such as block_content and node . You can use automatic prprocessed field data in the twig template simply with field machine name, template can specify for entity display mode and theme , supports attach assets library.
Features
- All content entity support.
- Editable twig template.
- Automatic preprocessd field data variable for twig template, all field data type support.
- Original field out put support.(use {{ field_name['#original'] }}).
- Twig variable alter api (hook_entity_widget_variables_alter).
- Theme and display mode specified template.
- Entity widget template support import and export.
- Template form edit format settings.
- Attach assets library.
- Attach context entity variables.
- Custom wrapper style plugin for views.
Twig variables
- The base variables for a field is the property defined in the data type,{{ field_name.value}} for text field and {{field_name.target_id}} for reference field.
- {% for item in field_name.items %} for multi value field
- {{field_name.render}} for text field html out put or rendered entity for entity reference field.
- {{field_name.styles.[style_name]}} for image or media image style url.
- {{field_name.media_source}} for media source url or value.
- {{field_name.render}} for views reference field render array with views content.
- {{field_name.data}} for menu reference field menu tree data.
- {{field_name.id}} {{field_name.uuid}} {{field_name.entity_label}} {{field_name.entity_url}} {{field_name.entity_type}} avaliable for all entity or entity reference field.
Tips
- Use {{ dump(_context) }} to debug avaliable variables in twig template.
- Twig edit format settings in /admin/config/development/entity-theme-engine
Recommended modules
- Ace Code Editor for twig edit.
- Views Reference Field for views data source.
Similar modules
Ask your assistant about Entity Theme Engine
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
- block Drupal core
- node Drupal core
- serialization Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
More in the Entity ecosystem
Most installed first