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

Problem accessing outer AND inner indexes inside nested arrays at the same time #781

Open
RaDangelo opened this issue May 7, 2018 · 0 comments

Comments

@RaDangelo
Copy link

Hi, I've got nested arrays such as this one:

"outer" : [
{
"inner": [
{},
{}
]
},
{
"inner": [
{},
{}
]
}
]

I neeed to generate an output like that one:

outer[0].inner[0]
outer[0].inner[1]
outer[1].inner[0]
outer[1].inner[1]

My problem is that once I'm inside the inner context, I do not know the outer index. $idx gives me the index of inner. Is there a way for me to access the outer index inside the inner context?

Template example:
{#outer}
{#inner}
outer[???].inner[{$idx}]
{/inner}
{/outer}

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

1 participant