<p>Good afternoon,</p>

<p>Is it possible to have a next prev button to cycle through a number of matrix blocks within a single entry and show the blocks content individually on screen? The block contains an entry from another channel.</p>

<p>If so, can someone point me in the direction of docs for it as Im struggling to find at the moment.</p>

<p>Many thanks.</p>

CC BY-SA 4.0
2019-06-20T10:49:27.563Z
not sure i follow. do you want to have some kind of pagination for matrix blocks where one block = single page?
Piotr Pogorzelski
CC BY-SA 4.0
2019-06-20T12:01:49.140Z
indeed, so one block references an entry from another channel. I have 12 blocks I want to paginate with next/prev.  in the same way normal entry pagination happens with in channel entry query, just restricted to the entries found in the matrix blocks
user9822
CC BY-SA 4.0
2019-06-21T21:35:40.177Z
OK, so you want to loop through entries that were used in matrix field. In that case you can just construct entry query and use `relatedTo` parameter that will get all entries related to entry that has this matrix field. And then just paginate results using `paginate` function.
Piotr Pogorzelski
<matrix><blocks>
Matrix Block query next prev
# Matrix Block query next prev

(Asked by: username_0 on 2019-06-20)

Good afternoon,

Is it possible to have a next prev button to cycle through a number of matrix blocks within a single entry and show the blocks content individually on screen? The block contains an entry from another channel.

If so, can someone point me in the direction of docs for it as Im struggling to find at the moment.

Many thanks.

**Tags:** matrix, blocks
> **Comments:**
> **username_1**: not sure i follow. do you want to have some kind of pagination for matrix blocks where one block = single page?  
> **username_0**: indeed, so one block references an entry from another channel. I have 12 blocks I want to paginate with next/prev.  in the same way normal entry pagination happens with in channel entry query, just restricted to the entries found in the matrix blocks  
> **username_1**: OK, so you want to loop through entries that were used in matrix field. In that case you can just construct entry query and use `relatedTo` parameter that will get all entries related to entry that has this matrix field. And then just paginate results using `paginate` function.  

---

## 0 answers

