0

I have installed Barrio Bootstrap (8.x-4.33) and it worked so far. But I can't override a template for a specific node type. I copied the original template into my subtheme/template folder and named it like suggested in the FILE NAME SUGGESTION (debug mode). E.g.: bs-2col-bricked--node-cuba-casa-particular-full.html.twig

This doesn't work.

Only when I name it like the original file bs-2col-bricked.html.twig it works.

I tried also 5.1.4, but it's the same. Anything wrong with the FILE NAME SUGGESTIONS?

In my Bootstrap3 theme it worked.

Can anybody help, please.

2
  • Did you enable Twig debugging and can you see the template suggestions printed as HTML comments when you inspect the markup? – leymannx Nov 22 '20 at 18:58
  • Yes Twig debugging is enabled and I see the comments in the source code. A bit of light: It seems so, that I only can override the "basic" templates. I tried with node.html.twig and this worked with node--cuba-casa-particular--full.html.twig Display suite and Bootstrap Layout templates doesn't, although FILE NAME SUGGESTIONS show suggestions. I guess, this is because Bootstrap 4 doesn't work with DS and Bootstrap Layout. – Breaky Nov 22 '20 at 21:13
0

My solution was to turn off the layout ('Manage display' --> 'Select a layout' --> 'none'). Now the debug mode FILE NAME SUGGESTIONS showed the correct suggestions. I was able to override the 'node.html.twig' in my subtheme (in my case with 'node--CONTENT-TYPE--full.html.twig')from 'themes/bootstrap_barrio/templates/content/'.

Neither the FILE NAME SUGGESTIONS for the DS (8.x-3.9) nor the Bootstrap Layouts (8.x-5.2) were working (the one you see in debug mode, when one of those layouts is selected in 'Manage display').

Maybe there is a better way ...

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.