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

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

nicxvan created an issue. See original summary.

nicxvan’s picture

I found a related issue

nicxvan’s picture

Project: Drupal core » Twig Template Suggester
Version: 9.4.x-dev » 8.x-1.x-dev
Component: theme system » Code

Moving this to the module providing the templates.