Closed tschortsch closed 2 years ago
Unfortunately, this is unsupported. It is a common request but it requires a rewrite of the plugin. We will look at adjusting the workflow to accommodate dynamic templates. At the moment the templates are statically rendered before the campaign launches.
I would like to call the
nl2br
twig-filter on atextarea
syntax field in my template. As I can't do this directly I tried to define a variable first like this:Since this didn't work as expected I started analyzing the parsing related code. It seems that the twig syntax is parsed during the
CmsController::render
call in thegetPageContent()
function inmodels/Message.php
. The SyntaxParser is called after this which means that this line{{ intro|nl2br }}
is already replaced by the stringintro
before the variable gets parsed.Wouldn't it be possible to change this behavoir that the SyntaxFields get parsed before the twig parser get's called? (like the RainLab.Pages plugin does).