I am using Layout Builder and I would like to tweak template file a bit. I can see suggestions here: enter image description here

But although I added file layout-twocol-section--node-npx-training-teaser2.html.twig in my theme templates folder, Drupal was still picking up the core layout--twocol-section.html.twig

I thought that maybe for some reason it doesn't look to my theme templates folders in this case (it certainly is picking up other custom templates from this folder), but when I placed there layout--twocol-section.html.twig file in my theme templates folders it is being picked up, so only the other suggested templates are not being picked up, I tried also layout-twocol-section--node-teaser2.html.twig, but without luck.

Why is that? Should I point Drupal to these templates somehow? These suggestions are just generic suggestions from Layout Builder, I was able to find them also on my node display: enter image description here

As you can see the names of the suggested files are a bit different so I tried layout--twocol-section--node-npx-training-teaser2.html.twig and layout--twocol-section--node-teaser2.html.twig, but no luck. Caches were cleared multiple times :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.