mzfp Posted February 8, 2023 Share Posted February 8, 2023 Hi I'm experimenting with overriding and extending twig templates from a custom Prestashop module. Custom file: modules/my_module/views/PrestaShop/Admin/Sell/Customer/view.html.twig In the file above if I place: {% extends '@PrestaShop/Admin/Sell/Customer/view.html.twig' %} It crashes the back office - no error - simply runs out of memory. However, if use the following approach it works: {% extends '@!PrestaShop/Admin/Sell/Customer/view.html.twig' %} note that I added the ! operator just before Prestashop. What is the difference and why does one work and not the other? Link to comment Share on other sites More sharing options...
ps8modules Posted February 8, 2023 Share Posted February 8, 2023 Hi, https://github.com/PrestaShop/PrestaShop/issues/29827 https://twig.symfony.com/doc/2.x/tags/extends.html Link to comment Share on other sites More sharing options...
mzfp Posted February 8, 2023 Author Share Posted February 8, 2023 Thanks. Am I correct in my understanding that the not operator (!) ensures that the template is extended from the base template (and another version extended from another module) ? I read through both links but could not really find a clear explanation of why the ! operator needs to be used. I'm curious about this Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now