-
I don't understand how I can reference an entire collection from within a block. I would like to build a block that enables the user to reference a collection that will be included in the block. What I've tried:
This question follows #1516 in my process to understand the architecture of payload (how it is meant to be used). Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @unonweb — I would go with your second option but I think you're thinking about this a bit incorrectly.
The collection data is saved in the separate collection. I think you're trying to duplicate it or similar, which would not be a good idea. Here's a use case that we come up against a lot. Say you're building a Next site on a layout-builder mentality, and you have a few blocks. One is The way we'd do this would be either one of two ways:
In either case, your block itself would only store |
Beta Was this translation helpful? Give feedback.
Hey @unonweb —
I would go with your second option but I think you're thinking about this a bit incorrectly.
The collection data is saved in the separate collection. I think you're trying to duplicate it or similar, which would not be a good idea.
Here's a use case that we come up against a lot.
Say you're building a Next site on a layout-builder mentality, and you have a few blocks. One is
Archive
or similar that allows a user to choose a collection to render an archive for, and then the frontend component should output the most recent 10 posts in the collection that was selected.The way we'd do this would be either…