Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I loop through an array passed as the context? #303

Open
Sweeper777 opened this issue Sep 29, 2020 · 1 comment
Open

How can I loop through an array passed as the context? #303

Sweeper777 opened this issue Sep 29, 2020 · 1 comment

Comments

@Sweeper777
Copy link

For example, if I have:

{% include "myTemplate.stencil" array1 %} {# "array1" is an array #}

And in myTemplate.stencil, how can I loop though it?

{% for item in ??? %}
    ...
{% endfor %}

I can't seem to use the array properties either, like {{ count }}.

@djbe
Copy link
Contributor

djbe commented Jul 30, 2022

Currently you can't. If anyone knows if Jinja handles this, and how, that info would be very welcome. I did a quick search but couldn't find any information about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants