Meta Box
Support Forum
Support › MB Views › Get the position of item in a sortable groupResolved
Hello.
I have a group with sortable items. In a view, I would like to retrieve the position of my items depending on the sorting I have set. I don't use the default sorting in view so i can't just use {{loop.index}}.
Do you have an idea of how to proceed ?
Thanks.
Hello,
The position of the cloneable group is the index of the array and it starts from 0. For example:
post.group_id[0]
Or you can use this code to print the group structure
<pre> {{ mb.print_r( post.group_id ) }} </pre>
Thanks. It help me.