12% off of LTD using this coupon: TWELVEPERCENTOFF. Promo ends on 2 Dec midnight UTC.
Published on Oct 12, 2021

[Condition] Every nth Post in Repeater (Loop Counter)

Sridhar Katakam

In this members-only tutorial we shall register a custom condition in Oxygen for outputting elements inside a Repeater's Div only every nth post where n can be specified in the condition.

Once the condition is in place, applying

for example, to a Text component inside the Repeater's Div will make it output for the 3rd, 6th, 9th and so on (counting from the latest).

This is based on the code from Loop Counter for Repeaters in Oxygen tutorial.

We shall also set up the !== operator in our condition meaning it can also be used for outputting elements that are NOT every nth position.

Step 1

Install and activate Code Snippets plugin.

Go to Snippets > Add New.

Title: [Condition] Every nth post for Repeater

Code:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $599 one-time).

Already a member? Log in below or here.

tagschevron-leftchevron-rightchainangle-rightangle-upangle-downfolder-omagnifiercrossmenuchevron-downarrow-right