I am using a PHP product called Mautic which leverages the TWIG template language.
They have some tokens that are accessed similar to
{subject}
and
{contactfield=company}
I want to be able to use the | raw function but when I try
{contactfield=company | raw}
it breaks on me.
If I set a variable then I can use the double curly braces and the functions like raw.
So I am thinking that I need to set a variable to the contactfield=company and then I can access it via the double curly braces. This is how I tried to do it but no luck.
{% set myvar = contactfield=company %}
I tried to use the dump() to guess at what the variable name might be in the context but it appears that command is disabled.
I'm not sure what the syntax should be.
UPDATE
I ran the following code
<ol>
{% for key, value in _context %}
<li>{{ key }}</li>
{% endfor %}
</ol>
and got this result
- isNew
- slots
- content
- template
- basePath
- app
- cfos
- _parent
I suspect that the {contactfield=company} is probably some shorthand for an attribute on one of these variables but not sure how I can dig into the top level context variables to see what other data may be lurking underneath.
I tried using {{dump()}} in the template but that seems to be disabled.
If I knew how to inspect these top level variables I might be able to figure out where this information lives. Unfortunately I don't have access to the PHP environment so I have to discover the information through trial and error.