I’m trying to change the height of my page according to the number of elements in a repeater. For example, if the repeater has 4 elements, it should have space for one single row, but if it has 8, it should have space for two rows, and so on.
The repeater is inside a strip, which is inside a section.
I believe the height of the repeater itself adapts to the number of elements, but as the strip and section have the default size of a single repeater row, when there are more than 4 elements, they don’t display.
How can I dyanamically resize the strip and the section so they adapt to the size of the repeater? Either a code or editor solution is ok.
I’m unsure if there is more to the use case but double-clicking the section below the section should fill in any space available and if you delete or add items to the repeater (either statically or via the CMS), it will adjust automatically without the need for code.
@Rob, thank you so much for your reply. How could I forget this info… That’s actually how repeaters are supposed to work! Huge miss on my side. Apologies for that.
Also, thank you so much for reminding me about it. Thanks to your message, I thought “well, then I must be doing something wrong somewhere”, and voilà, that was the case. First, the dataset that my repeater was using in the editor had a small number of elements per load (maybe this was being overwritten by my code), but anyway, I was also setting that same small number in a function where I was fetching the data from the CMS, and that was the main problem. Once I made the change to a bigger value, the problem was solved.
Thanks once again for the wake-up call!!!
(By the way, when fetching data from the CMS, I am also using a function to get an info field from the registered user’s profile, should anyone who reads this be interested in something similar! You can check it here: Fetch and use site members' custom info fields )