I have two repeaters on a single web page, one above the other.
I change the content of the repeaters and this can sometimes mean that there is no content in either or possibly both of the repeaters.
My problem is that if the repeater at the top of the page ends up with nothing in it, I want the second repeater to display at the top of the page, as if the repeater is not there at all.
I have tried using the .collapse and .hide functions for the top repeater if it has no content, but these functions do not completely remove the repeater from the page, and the 2nd repeater doesn’t move up the page into it’s place.
Is there a way to do this nicely, so that I can achieve what I need to do?
I’d be really grateful if someone could please suggest possible solutions.
Thanks!
Try to put them both in a box and then use the collapse method.
(and if you’re using EditorX group them into a stack)
Thanks. But what do you mean by a box? Do you mean their own section or do you mean something else? Thanks.
not sure about the box, but it should work if you put them both inside their own strip, and .collapse the strip rather than the repeater
I mean: add a box element to the page, and put them both in the box.
Reason: sometimes another element on the page (usually on one of the sides) prevents the bottom repeater from going upward on collapse (there’s a complicated logics under re whether or not to change the location on collapse). Putting them together in a parent box prevents interference from other page elements
Thanks guys. I ended up placing each repeater in its own column strip and simply collapsing the column strip if there were no entries to display in the repeater. This worked really well. Thanks for your help.