Daniel81
Daniel81

Hi,

Does anyone know how to output rendered/parsed TWIG syntax from the CodeEditor widget i.e variables, loops etc ?

Thanks in advance.

Daniel81
Daniel81

Figured it out :)

For anyone interested, you need to enable the Twig extension "template_from_string"

e.g

Event::listen('cms.page.beforeRenderPage', function($controller, $page) {

    $twig = $controller->getTwig();
    $twig->addExtension(new \Twig_Extension_StringLoader());
});

Hope this helps anyone with a similar need to mine :)

1-2 of 2