I have picked up the basics of using TWIG to create my site. I suppose I know how to use {%extend%}
{%block%}
{%include%}
and {%set%}
, in the most general sense.
I would like to include a block of code from within another twig file without including the whole file - as opposed to {% include 'file.twig' %}
.
I have figured out how to set a variable in file.twig
and output it using {{ variable | raw }}
. I would like to do that in another file, like you would with using jQuery's .load
function.
I swear the twig documentation does not seem to touch on this, it seems like really obvious and basic functionality. I have messed around with various combinations of include, for, with, in and only, colons and commas and whatever | is, and nothing.