v13+ - enable or disable (or show/hide) a block in a blocklist based on ContentType #16312
Replies: 2 comments 4 replies
-
You can easily create a copy of a BlockList datatype and change what is available on it. Since Content Types each have their own properties, it would be possible to use one or the other datatypes on the different Content Types. This would be useful in the case of a Composition - if, for instance, you have a generic "Main Content" composition which you want to add to multiple page types, and your Block List property is on there... But it feels like a lot of extra work for the back-office to check the current Content Type before rendering the available blocks, however... |
Beta Was this translation helpful? Give feedback.
-
Very interesting @nathanwoulfe...thank you. For your info...on our.umbraco I also received another tip. Jamie Townsend suggested me to try to use the SendingContentNotification (documentation: https://docs.umbraco.com/umbraco-cms/reference/notifications/editormodel-notifications) Adriano |
Beta Was this translation helpful? Give feedback.
-
Hi, I use blocklists a lot and often reuse the same blocklist for different purposes.
It would be very useful, when configuring a block in a blocklist, to be able (optional) to specify which documentTypes can useit (multiple choice) or which documentTypes cannot use it (probably better).
This is an example:
I create a DocumentType Homepage with a blocklist that has two blocks AccordionBlock and SliderBlock
I create also a second DocumentType Article with a blocklist that should have only the block AccordionBlock.
At present, I must create two different blocklists, but it would be very useful if within the configuration of the SliderBlock I could select which DocumentTypes can use (Homepage) or cannot use (Article) the block.
This way, when I create a new article in content I couldn't add the slider
Have a nice day
Adriano
Beta Was this translation helpful? Give feedback.
All reactions