R
R
Rickkk2019-12-11 14:03:40
opencart
Rickkk, 2019-12-11 14:03:40

How to share twig templates in catalog and admin sections of a site?

Faced such a problem. I wrote a module for Opencart that calculates shipping costs. It is embedded in the order form and allows you to select the delivery point on the map.
When loading the map, you need to show the preloader. In case of problems - a modal window.
There is a separate section in the admin panel for processing orders with this delivery. There I would also like to use the preloader and the same modal window. Now I have to duplicate preloader and modal twig templates in admin/view/template/... and catalog/view/template/....
I don't want to duplicate these templates. I would like the controllers from both the admin and catalog sections to be able to render these templates, which are in single instances in one of the folders. How to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Makssof, 2019-12-11
@makssof

https://twig.symfony.com/doc/3.x/tags/macro.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question