0

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.

  • not sure i follow. do you want to have some kind of pagination for matrix blocks where one block = single page? – piotrpog Jun 20 '19 at 10:49
  • 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 Jun 20 '19 at 12:01
  • 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. – piotrpog Jun 21 '19 at 21:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.