Stacks API

Come build with us.
Stacks API v13 for Stacks 5.0

  <   Templates Variable Reference

This content is open source. You can edit it and submit a pull request on GitHub.
This page is generated from this file.

© . YourHead Software all rights reserved.

Repeating Blocks

%[repeat]% %[endrepeat]%

Deprecated: Stacks API v7
This template will be available for at lest 12 months after deprecation.
Available: Stacks API v2

Deprecation Notice: This template has been deprecated due to poor performance. You should migrate your stacks to use other API in its place (such as the addTypes property on containers). Stacks 3.0 will continue to support %repeat% for at least 12 months after release.


%[repeat 4]%
using a property with a slice as the content


%[repeat my_slider_ID]%


The repeat block will repeat the contents between the repeat and endrepeat keywords. The block can either be repeated a fixed number of times by using an integer or a variable number of times by using a property ID.

Inside of the repeat block a special custom variable will be active. The “repeatIndex” variable will be replaced by the index of the repeated content. The index will start at 0 and increment to (n-1).

You can include %slice% %text% or any other template variables inside the repeating block.

You can nest repeat blocks.

Warning: Repeat blocks come with a significant CPU cost. To make your stack perform well, keep your repeat blocks as simple as possible and limit the count. Repeat blocks are included in the API because there are currently some problems that cannot be solved without them – but you are urged to find other solutions and use this only as a last resort.

© . YourHead Software all rights reserved.