When rendering templates the variables are not being rendered in time for use in context.
Example:
<ul class="nav">
{% for link in navigation.main-navigation.links %}
<li class="cf">
<a href="{{ link.url }}">{{ link.link_name }}</a>
<ul class="nav">
{% for l in navigation[link.handle].links %}
<li><a href="{{ l.url }}"{% if l.active %} class="current"{% endif %}>{{ l.link_name }}</a></li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
The key issue in the above:
When attempting to utilise for loop variables as array keys they fail.
The desired affect (and how Shopify liquid works), is the variable is output as it's value, before further liquid markup is rendered, meaning the variable value can then be used right away in context. In this case, as an array key.
The correct output example:{% for l in navigation[my-link-handle-value-after-being-rendered].links %}
Instead it's not rendered and you're left with the variable name itself.
Current output example:{% for l in navigation[link.handle].links %}
When rendering templates the variables are not being rendered in time for use in context. Example:
The key issue in the above: When attempting to utilise for loop variables as array keys they fail.
The desired affect (and how Shopify liquid works), is the variable is output as it's value, before further liquid markup is rendered, meaning the variable value can then be used right away in context. In this case, as an array key. The correct output example: {% for l in navigation[
my-link-handle-value-after-being-rendered
].links %}Instead it's not rendered and you're left with the variable name itself. Current output example: {% for l in navigation[
link.handle
].links %}