I'm struggling to understand the best practice around blocks and collections, in the context of the official website template.
❓ How should I think of the relationship between a block and a collection?
For example, say I want a testimonial collection. I then want two sections: a grid layout that contains 18 testimonials rendered as cards, and a section that displays just one testimonials in the same card.
These are my thoughts:
- The card used to render testimonials is the same, so the UI should be shared
- I want to use the pages collection blocks to render these blocks on pages
- I want the blocks to reference the testimonial collection
However, every time I've tried setting up this situation, I run into depth issues and can't get the relationships to work.
I'm also concerned about the fact that data could change in the testimonials collection, so do I have to setup a hook to run and revalidate each page the block is used on? That seems tedious and prone to error if the site evolves.
--
Am I misunderstanding blocks and their relationship to collections?
Is the website template just not really setup to do this?
Are there any examples of doing something similar to this I can look at?