Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By plopesc on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
Previously node template suggestions were only based on the nodes' bundle and their id. It was very common to add manually new suggestions based on the view modes manually by themers to get a more flexible template architecture. So these template suggestions have been added to core.
Previously, in D7 and D8 before the patch:
<!-- THEME DEBUG -->
<!-- CALL: _theme('node') -->
<!-- FILE NAME SUGGESTIONS:
* node--1.html.twig
* node--article.html.twig
x node.html.twig
-->
<!-- BEGIN OUTPUT from 'core/themes/bartik/templates/node.html.twig' -->
D8 after the change:
<!-- THEME DEBUG -->
<!-- CALL: _theme('node') -->
<!-- FILE NAME SUGGESTIONS:
* node--1--full.html.twig
* node--1.html.twig
* node--article--full.html.twig
* node--article.html.twig
* node--full.html.twig
x node.html.twig
-->
<!-- BEGIN OUTPUT from 'core/themes/bartik/templates/node.html.twig' -->
This change adds new feature required by a huge number of developers and themers out of the box.
Impacts:
Module developers
Themers