this works in my main text page template to give me the total count of items in the slot, but it doesn’t work in my snippet to give me the position. When I plug in the variable in my snippet template it’s not resolving.
A loop counter for Slot contents; can only be used in a Slot. The index of the Content Items in the Slot. Indexing begins at 1. (In other words, the first Content Item in the Slot is index1, the second index 2, and so on.) This variable can be used to modify the rendering of different rows in the Slot, or to add more data to the Snippet rendering
Thought someone else might be able to re-use this code, if you have any improvements please let me know.
I wanted to dynamically wrap a snippet item within a table but this posed some problems with how to also grab the table row header. The snippet item is a special template used to show departments in a directory style table listing.
all “<” are removed for display.
** I placed the table tags outside of the body to prevent them from being included with the snippet.
The snippet passes the table header and data associated with the department within each snippet.
The auto index in this example returns multiple department snippets with the auto index template and combines them into one table element. This is where I found a use for the $velocityCount variable mentioned in the previous post. A regular expression is used to remove the table header passed in by the snippet template.