Support

Account

Home Forums Add-ons Flexible Content Field Count repeater rows within flexible content layout

Helping

Count repeater rows within flexible content layout

  • I’ve got a set of accordion repeater fields within a flexible content layout. For the accordion to work I need something like get_row_index() but that keeps a running count each time the layout is looped.

    Right now if I put get_row_index() within my accordion repeater, but have other flexible content layouts in between, the output is as follows:

    accordion-1
    accordion-2

    Some other flexible content

    accordion-1
    accordion-2

    What I need is:

    accordion-1
    accordion-2

    Some other flexible content

    accordion-3
    accordion-4

    Any help would be greatly appreciated!

  • You are going to need to create some kind of a counter that is initialize before the first repeater and get incremented along the way.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.