I\'m working on a project that\'s based on the twig patternlab framework. I\'m using JSON files for most of my content, especially for pages.
I want to integrate a l
To solve this issue you would first need to enable the extension Twig_Extension_StringLoader
. This give you access to the function template_from_string, which give you the ability to "create" templates inside twig
and (re)enable the string interpolation you need.
register extension
$twig->addExtension(new Twig_Extension_StringLoader());
use template_from_string
to achieve desired effect
{% set legalLink = 'Datenschutzbedingungen' %}
{{ include(template_from_string('{{ "'~contact.legal~'" }}')) }}