N
N
Nikita Reshetnyak2020-06-24 14:07:06
Twig
Nikita Reshetnyak, 2020-06-24 14:07:06

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

1 answer(s)
A
Anton, 2020-06-24
@trjflash

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 question

Ask a Question

731 491 924 answers to any question