Problem/Motivation
I am using page level templates to handle page layout for a landing page.
The page type had the following requirements.
Landing pages have a default layout for a given campaign.
Once a campaign is over the layout should be preserved for past landing pages.
I initially planned to do this using `page--node--event-highlight.html.twig` for the current active campaign.
And then using `page--node--3920.html.twig` for the past campaigns.
Template suggestions generally go:
- Most specific
- Slightly less specific
- Broadest
The template suggestions instead are read in this order:
- x page--node--event-highlight.html.twig
- * page--node--3728.html.twig
- * page--node--%.html.twig
- * page--node.html.twig
- * page.html.twig
A page node template with the specific NID should be the most specific template but even though there is a `page--node--3728.html.twig` The bundle template is taking precedence.
Steps to reproduce
Install drupal
Create Article
Create page--node--article.html.twig template
Create page--node--1.html.twig template
Comments
Comment #2
nicxvan commentedI found a related issue
Comment #3
nicxvan commentedMoving this to the module providing the templates.