Odd and even items in <repeater>


I am wondering if it is possible to somehow output different styles for odd and even items in the repeater listing. We would like to create a layout where image position alternates between left and right for the items listed.



Diana Diana, 6 years ago

Hi Filip,

I'm afraid not. Repeaters repeat the exact same code over and over, so you couldn't have different sections alternating. You could create a static template though, without repeaters, where you have a present number of sections using title, description and image tags and you just always have 2 of each type or 3 of each type, etc rather than being able to add new sections as needed.

D. Potter
Campaign Monitor
BThies BThies, 6 years ago

You could create a template and put each section (odd and even) in its own repeater.

Create 4 or 5 of each repeater (alternating), and simply delete however many you won't be using within the interface when the time comes.

Brian Thies
Professional Email Developer
Thies Publishing
Diana Diana, 6 years ago

True, they won't alternate though. It would still be something like Odd, Odd, Odd, Even Even Even, Odd, Odd, Odd, Even, Even, etc

D. Potter
Campaign Monitor
BThies BThies, 6 years ago

The repeaters wouldn't be there to actually repeat.  They'd simply provide a means to "delete" sections.

So if someone only wanted to use four sections, it'd still be Even, Odd, Even, Odd, Deleted, Deleted ,Deleted, Deleted.

Design for maximum usage and delete what isn't used within the interface.

Brian Thies
Professional Email Developer
Thies Publishing
filip.dostal, 6 years ago

OK, this confirms my assumption. Thank you both!


thermalcreative, 6 years ago

I'd like to add a feature request for some kind of "zebra" or odd/even support in repeaters. I've had a number of designs given to me by designers that I work with that need some type of odd/even support, usually to alternate the image alignment with each entry in a repeater. I usually have to tell them no, since the solutions mentioned on this thread really don't work for most clients. It's a little thing, but it would add a ton of flexibility with what we can do with templates.


markwittens, 6 years ago

I've seen requests for this feature dating 3 years ago, I also would like to see this feature for exactly the reasons described in this thread. To me it seems like a feature that can be built with not too much effort and it would add great flexibility to the creation of templates.

So, Campaign Monitor: Are there any plans to implement such a feature?

Stig Stig, 6 years ago

@thermalcreative and @markwittens, I just wanted to confirm that while this isn't a feature we're currently planning, we're recording every vote. These votes are always taken into account as future updates are planned, so keep them coming.

The Campaign Monitor Blog – HTML email smarts to go with your good looks.
allyelle, 5 years ago

I'd like to add a request for this feature...

roshodgekiss roshodgekiss, 5 years ago

Thanks, allyelle - it's noted. Welcome to the forums, btw :)

Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor
trexart, 5 years ago

+1 for this feature as well.

It would really allow for templates to not look as much like a template.

Carissa Carissa, 5 years ago

@trexart - thanks for your vote, I've just recorded it for you.

Campaign Monitor
jerallyn jerallyn, 5 years ago

I have odd/even repeater blocks in a template, but I can't drag/drop an 'odd' block in between 2 'even' blocks.
+1 for this.

Stig Stig, 5 years ago

Thanks jerallyn,

We've recorded your vote.

The Campaign Monitor Blog – HTML email smarts to go with your good looks.

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free