Hi
I have a repeater set up to display and filter stills and information but i’m struggling with a couple of things.
-
how to make each button only load a certain number of images.
-
how to make my load more button disappear when theres no more items left to load. So i can have a load more and load less button to expand or collapse the repeater.
-
how to make a load less button
-
I have 4 buttons set up to filter the information in the repeater to display the images & info i want it to. When the button first loads it displays 8 pictures. I have a load more button below the pictures which loads 8 more images each time its clicked. When i select a different category i want it to automatically reset the load amount to 8. So when i click each option it will only display 8 images even if the load more button has expanded the repeater.
See Pic
The code i have used for the repeater buttons is as follows.
// … filter to commercial
export function commercial_click() {
console.log(“filtering items to commercial”);
$w("#datasetfilm").setFilter( wixData.filter().contains('catagory', 'commercial') );
}
- I would also like to create a way to expand and collapse the repeater. At the moment if you click the button the page becomes longer and longer with no way of resetting it. I would like to either have a load more and load less button or another solution to make this work. If i have 2 buttons i would like them to disappear when theres no more items to expand or collapse similar to how the galleries would work if you want to show more or less images.
I have my load more button connected to my data base, but there doesn’t seem to be an option to load less. see pic
I’ve also tried multiple times to make the load more button show and hide with code but i’ve had no luck.
I’ve been working on this for about 2 weeks now and have tried lots of options based on other posts or on the WIX API lists but i just can’t figure it out. I’ve managed to get everything else on my site working but i’m just going round and round in circles with this part.
If anyone could help, or at least point me the right direction it would be really appreciated.