Hi ![]()
If you’re using a dataset, you can set the the page size on the dataset settings, however, if you’re using data binding, you can set a limit on the query to get you exactly 4 items.
wixData.query('Collection').limit(4).find();
Additionally, if you already have the array, you can use the JavaScript slice method to return a specific length or items.
const vendors = ['BMW', 'Shkoda', 'Seat', 'Volvo'];
To get the first 3 items, use the following:
const firstItemIndex = 0;
const lastItemIndex = 2;
const modifiedArray = vendors.slice(0, 2);
/* Expected result:
['BMW', 'Shkoda', 'Seat']
*/
Hope this helps~!
Ahmad