Skip to content

Unable to use the value variable inside array #8225

Closed Answered by jasonvarga
videni asked this question in Troubleshooting
Discussion options

You must be logged in to vote

If the asset has its own favourites variable, it should override the outer one.

I'm assuming where you are seeing the outer one, it's because that particular asset in the loop doesn't have its own favourites.

You can get around this by using a scope.

{{ favourites }}

{{ interiors scope="interior" }}
  {{ interior:favourites }}
{{ /interiors }}

By using the scope, each iteration will be inside the given variable (interior). So when you do {{ interior:favourites }}, it will only get it from inside interior and won't fall back to the parent.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@videni
Comment options

Answer selected by videni
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants