-
Notifications
You must be signed in to change notification settings - Fork 7
Repeat
The repeat template from the Stacks 2 API along with its companion templates:
%[repeat n]%
%id=repeatIndex%
%[endrepeat]%
As noted in the API documentation, the performance of repeat is poor. It is also very inflexible: it doesn't allow stack reordering or removing a stack from the middle of a group. The bottom line: it makes customers unhappy. We can do better.
The exact date is not known, but it will be at least 12 months from the release of Stacks 3. In that time most developers should have moved to new stacks.
Repeat will be for another year, but the replacement is here today. If you're adding new features or building new stacks, use the new API.
Repeat was used for repeating sub-elements and or containers. Add-Types lets the user add specific sub-stacks to a container. Sub-stacks can be wrapperless, confined only to your stack(s), and hidden in the library. This covers many of the same features of repeat, in a more flexible and customizable way.
And it goes without saying, but the new API solves the existing problems: it's fast and it allows the customer to reorder/delete in the usual stacks way.
The easiest way to get started is to see it in action. The Image Fun stack is a complete working example stack that uses the addTypes API, inline (wrapperless) sub-stacks, and a lot more. It's open source and here on GitHub.