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

forloop.parentloop unsupported #510

Closed
trevorlacey-msft opened this issue Sep 21, 2022 · 0 comments · Fixed by #511
Closed

forloop.parentloop unsupported #510

trevorlacey-msft opened this issue Sep 21, 2022 · 0 comments · Fixed by #511

Comments

@trevorlacey-msft
Copy link

The forloop.parentloop object is not supported. Liquid documentation here.

Example:

List of countries:
{%- for continent in world.continents -%}
  {%- for country in continent.countries -%}
    {{ country.name }}{% unless forloop.last and forloop.parentloop.last %},{% endunless %}
  {%- endfor -%}
{%- endfor -%}

Expected:
List of countries:canada,united states,mexico,guatemala,hondura,nicaragua,el salvador,costa rica,panama,belize

Actual:
List of countries:canada,united states,mexico,guatemala,hondura,nicaragua,el salvador,costa rica,panama,belize, (trailing comma)

Issue:
forloop.parentloop always returns nil, so forloop.parentloop.last statement is always evaluated as false.

sebastienros added a commit that referenced this issue Sep 21, 2022
sebastienros added a commit that referenced this issue Sep 21, 2022
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

Successfully merging a pull request may close this issue.

1 participant