- Give your next button a class of arrow-button with a combo class of next
- Give your previous button a class of arrow-button with a combo class of prev
- Add a collection list onto your collection page and give the wrapper a class of my-wrapper
- Drag a link directly into the collection item and give it a class of my-link
- Set the link to go to the collection page of each item
- You can set the wrapper to display none and apply any sorting order to the collection
<script>
let nextLink = $(".my-wrapper .w--current").parent().next().find(".my-link").attr("href");
if ($(".my-wrapper .w--current").parent().next().length == 0) {
let firstLink = $(".my-link").eq(0).attr("href");
$(".arrow-button.next").attr("href", firstLink);
} else {
$(".arrow-button.next").attr("href", nextLink);
}
let prevLink = $(".my-wrapper .w--current").parent().prev().find(".my-link").attr("href");
if ($(".my-wrapper .w--current").parent().prev().length == 0) {
let lastEq = $(".my-link").length - 1;
let lastLink = $(".my-link").eq(lastEq).attr("href");
$(".arrow-button.prev").attr("href", lastLink);
} else {
$(".arrow-button.prev").attr("href", prevLink);
}
</script>