Page type in head.twig



is there a way to find out the page type in head.twig: home, category, product, cart, …


Hello Josef,

That’s a bad idea from the architecture point of view. We would recommend doing the other way round: define an empty block in head.twig, and then fill it with category, product, cart and other templates as necessary. For details, see How to Organize Your Twig Templates Using Inheritance.

Best regards,

The Forum Team



Thanks for the reply, meanwhile i also figured out that my first solution was not good and i started to implement as you also recommended.