@Deight, Like in a previous question, you are looping inside a loop…
The value of val
is the same as the value for item
. Drop the inner loop and replace item.path
and item.name
with val.path
and val.name
.
To debug what is happing inside a Twig template, use {{ dump(variable) }}
and track the dumps in the ClockWork tab in the developer console of the browser.