I'm using nunjucks to render some variables:
<div class="zoomable zoomable-{{ slide.index }}"> << this works
{% if slide.temp is none %} << this doesn't
{% include "layouts/"+{{slide.layout}} %} << this doesn't
{% endif %}
</div>
When the JS calls nunjucks.render, I get the following error:
parseAggregate: expected colon after dict key
on the include
There are two issues with this:
- It's not supposed to skip the condition, because the property
temp
doesn't exist. - Is it not letting me access the
slide
properties? Becauseslide.layout
is valid
Am I doing something wrong?
I'm using nunjucks to render some variables:
<div class="zoomable zoomable-{{ slide.index }}"> << this works
{% if slide.temp is none %} << this doesn't
{% include "layouts/"+{{slide.layout}} %} << this doesn't
{% endif %}
</div>
When the JS calls nunjucks.render, I get the following error:
parseAggregate: expected colon after dict key
on the include
There are two issues with this:
- It's not supposed to skip the condition, because the property
temp
doesn't exist. - Is it not letting me access the
slide
properties? Becauseslide.layout
is valid
Am I doing something wrong?
Share Improve this question edited Apr 14, 2017 at 14:38 amigo21 asked Feb 27, 2017 at 16:54 amigo21amigo21 3912 gold badges6 silver badges18 bronze badges 1-
Also not sure if
none
is a valid parison, haven't used nunjucks before. Maybe tryif not slide.temp
– theleebriggs Commented Feb 27, 2017 at 17:30
1 Answer
Reset to default 10I think you just need to remove the curly brackets
i.e.
{% include "layouts/" + slide.layout %}