I have a top-level template where I want to use a "fragment" template inside a for cycle but I'm not able to pass in the variable value:
{% for item in coll %}
{% include "fragment.html" with name="slack" item=item %}
{% endfor %}
item
and name
is then used in the fragment.html template:
<div>
<label>
<input
title="{{item.id}}"
id="{{name}_{{item.id}}_active"
name="{{name}}-{{item.id}}_active"
...
/>
While the name
parameter is expanded properly (its value is hardcoded in the parent template), the item
parameter is not (its value is passed in as is).
Do I need to use a different syntax for that or it's just not supported?