You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context:
I'm working on a document type that has a predictable structure - As an example, Iet's say creating a recipe with the following blocks (parts of the document) - A header, an ingredients block, an instructions block, a media block, etc. All these blocks together would form the Document.
I would like to prevent a user from adding more than one "ingredients" block to the document for instance. An images block, the user can add as many as they wish. Or none. An instructions block would be required etc..
This is a contrived example, but it illustrates my use case. A document that has a predictable structure, but once a user adds a block for one part of that document, I don't want them to be able to add 5 types of a specific block where only one should exist.
Is this possible? Am I using blocks incorrectly in this instance? I'm relatively new to Payload, but I've been digging through the docs and source code for the last week and this discussion board. I'm sure I can eventually find an answer, but if it's possible, I'm hoping someone can point me the right direction. Is this an admin panel issue or should I be looking at the underlying db structure?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context:
I'm working on a document type that has a predictable structure - As an example, Iet's say creating a recipe with the following blocks (parts of the document) - A header, an ingredients block, an instructions block, a media block, etc. All these blocks together would form the Document.
I would like to prevent a user from adding more than one "ingredients" block to the document for instance. An images block, the user can add as many as they wish. Or none. An instructions block would be required etc..
This is a contrived example, but it illustrates my use case. A document that has a predictable structure, but once a user adds a block for one part of that document, I don't want them to be able to add 5 types of a specific block where only one should exist.
Is this possible? Am I using blocks incorrectly in this instance? I'm relatively new to Payload, but I've been digging through the docs and source code for the last week and this discussion board. I'm sure I can eventually find an answer, but if it's possible, I'm hoping someone can point me the right direction. Is this an admin panel issue or should I be looking at the underlying db structure?
Beta Was this translation helpful? Give feedback.
All reactions