You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is: in a List widget with fields (e.g. not "simple string list"), one could add a hidden field that holds the index of the current item in that list, like:
I could add support for the index, but indexes can be easily retrieved in the framework, right? In Svelte, that’s the each block’s second callback argument, and in Hugo, range $index, $value := $slice
Not always: in Hugo, it's idiomatic to filter a collection right before looping into it (a range (where <collection> <filter> expression). In that case, the indexes are not relative to the original collection, but to the filtered one, so an index field would be useful.
The idea is: in a List widget with fields (e.g. not "simple string list"), one could add a hidden field that holds the index of the current item in that list, like:
It could be a
hidden
widget withdefault: '{{index}}'
, or acompute
widget withvalue: '{{index}}'
, or even something else...The text was updated successfully, but these errors were encountered: