We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Looping through a collection with alternating modules

Jan Persiel December 15, 2020 by Jan Persiel

Hi there!

I could not find the right solution anywhere so I am turning to the wisdom of the crowd.

  • I have a collection (gin) and would love to loop through it.
  • First I would love to show entries 1-20 by name in a table
  • then 21-25 as cards with pictures
  • then 21-40 as a table
  • then 41-45 as cards with pictures
  • then 41-60 as a table … and so on

This should be repeated until I reach the end of the collection.

I know the entries amount with {{ collection:count in="gin" }} but I have no idea how to make use of this with {{ loop }} or how this mixes with php. Is there an example I missed here, in the documentation or on youtube?

Thanks for a hint how to tackle this!

>>>>>>> Unanswered <<<<<<<
4 Replies