I have searched for an answer for this without any success. Maybe someone else had ran into this?
I used to use the twig function "include". Eg, in my header.twig, I use to use this line:
{% include 'default/template/common/mobile-nav.twig' %}
Simply like a php include call. Now, upgrading to Opencart 3.0.3.5, this render in an error like this:
Fatal error: Uncaught Twig\Error\LoaderError: Template "default/template/common/mobile-nav.twig" is not defined in "default/template/common/header.twig" at line 34
Anyone got an idea how to rewrite this?
well personally I would put this in your controller anyway ..
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Well, you might as well update again because 3.0.3.6 is now out.
In any case there were updates to twig and the twig adapter class.
Its now using \Twig\Loader\ArrayLoader. vs the \Twig\Loader\FilesystemLoader, I don't understand why the loader was changed, but problem most likely lies there.
If you want to use twig include partials again, I suspect you will need to add some functionality. Twigs documentation gives some options on how to implement.
In any case there were updates to twig and the twig adapter class.
Its now using \Twig\Loader\ArrayLoader. vs the \Twig\Loader\FilesystemLoader, I don't understand why the loader was changed, but problem most likely lies there.
If you want to use twig include partials again, I suspect you will need to add some functionality. Twigs documentation gives some options on how to implement.
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
We had a solution for this proposed on github a while ago, I don't know why it hasn't been adopted by OpenCart:
https://github.com/opencart/opencart/pu ... -500143157
https://github.com/opencart/opencart/pu ... -500143157
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Who is online
Users browsing this forum: No registered users and 173 guests