I have a Pro Form with a repeater element mapped to an ACf repeater.
Inside this repeater I have the following structure
Repeater
Header with text pf “Person {brf_loop_index:1}” no quotes
Row-wrapper grid of 4 cols
Bf Number element
Bf Number element
Bf Number element
Bf Number element
This shows “Person 1” on every row.
Tried a different approach with the ID of the header element being " person_{brf_loop_index:1} and css on the blank Header element of
%root%::after {
content: attr(id);
}
But this show “person_1-1, person_1-2” etc.
Any ideas how I can get this working without adding extra code?
BTW, I have also tried using the BB query_loop_index but that doesn’t work either
So it seems that because I’m in a Update Post/Meta form, that looks like it is seen as a nested loop that’s why I get 1-1, 1-2 etc.
I feel that {brf_loop_index:1} should be able to tell the difference or better still offer an additional parameter of the nested level with 0 being the current level, 1 being the parent level, 2 being the grandparent level etc.
For now, I’m using a CSS counter to solve my immediate needs as follows;
On the repeater form element add custom CSS of
%root% {
counter-reset: person-counter;
}
Then on my Row Header content to "my row header " (in my case “Person-”) and set the CSS to
your CSS counter is currently the right way to do this, and here is why the tag behaves the way it does.
brf_loop_index reads the loop index of a Bricks query loop. It knows nothing about Pro Forms repeater rows. The repeater renders exactly one template row on the server, and the rows you see are cloned in the browser, either from the ACF data or when someone clicks “Add row”. So the tag is resolved once, before any cloning, and every clone carries the same “Person 1”.
The -1, -2 suffix you saw in the ID has nothing to do with a nested loop or with the Update Post form. That is the repeater itself: whenever rows are added, it appends the row index to every ID inside the row so labels and inputs stay unique. Your header ID becomes person_1 plus the row index. If you want a number without the prefix, your counter approach is the cleanest, since attr(id) will always include the original ID.
A dynamic row number exposed by the repeater itself does not exist at the moment.