Help loops Items Per Page
Hello,
I made an API call and got a response with a variable allAds containing 5 items and a variable adsTotalItems with the number 5:
I managed to loop through the 5 items, but now I want to implement a system for items per page. How could I do this? I have a variable itemsPerPage set to 2, so I want to display only 2 items with an option (yes/no) to show the next 2 items from allAds and the next 1 item to make it 5 in total.
Is it possible to do this?
2 Replies
Should be possible but a bit complex...
Heya Sullivan,
With the recent implementation of the Cards feature that allows to nicely display items in a scrollable carousel, it could be a potentially-satisfying solution to your desired pagination system.
To implement it quickly:
1. Where you normally display
allAds
, put a Cards
Input Block
2. Each field of the card "Title", "Description", "Image" can be a list of all your titles, descriptions and images respectively.
Would that suit your needs at least temporarily?