Answer the question
In order to leave comments, you need to log in
Using widget call inside HTML code from DB?
Good day! From the base I pull the content of the page on which there is an element worked out by the widget.
{{ page.page_content | raw }} inside page_content there is a construction {slider_widget_widget({})}} Tell me
how to make twig call the widget
I just started to figure it out, googling didn't help, thanks in advance!
Answer the question
In order to leave comments, you need to log in
Without being distracted by the reasons that prompted to store templates in the database, I think this function will suit you https://twig.symfony.com/doc/3.x/functions/templat...
Accordingly, you will have something like this in the template
{{ include(template_from_string(page.page_content)) }}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question