Thank you this is a really useful tip...I didn't think about using SendingContentNotification and I had only considered doing it directly in the backoffice.
Good luck, do let me know what you come up with as it's an interesting concept and I am looking to do similar but also a step more advanced in having what components can be picked in a grid depending on doctype but also the hostname for multi tenancy sites.
I had some some time to play, this was a quick and dirty throw together so if you use it, please refactor :)
But it seems to work, so this will only run on a doctype of 'Domain' and it will remove any block grid element if it's called 'Content Card Component'. Again probably a better option than it's label but as a POC it works.
Credit to Callum Whyte as this is essentially the same as he's showed in his fantastic talk 'Block to Basics'
v13.3.0 - Disable (or hide) a block in a blocklist, based on DocumentType
Hi, I have created a blocklist with 3 blocks (sliderBlock, bannerBlock, linksBlock)
I would to reuse this blocklist in different DocumentType, but in one of them I don't need the sliderBlock
Is there a way to hide or disable the sliderBlock in certain DocumentTypes so I can reuse the same blocklist?
Thank you
Adriano
Hi there, you could/should be able to do this via
SendingContentNotification
documentation is here https://docs.umbraco.com/umbraco-cms/reference/notifications/editormodel-notificationsHi Jamie,
thank you for the support.
Thank you this is a really useful tip...I didn't think about using
SendingContentNotification
and I had only considered doing it directly in the backoffice.I'll try soon and I'll let you know if I succeed
Thank you very much
Adriano
Good luck, do let me know what you come up with as it's an interesting concept and I am looking to do similar but also a step more advanced in having what components can be picked in a grid depending on doctype but also the hostname for multi tenancy sites.
I had some some time to play, this was a quick and dirty throw together so if you use it, please refactor :)
But it seems to work, so this will only run on a doctype of 'Domain' and it will remove any block grid element if it's called 'Content Card Component'. Again probably a better option than it's label but as a POC it works.
Credit to Callum Whyte as this is essentially the same as he's showed in his fantastic talk 'Block to Basics'
is working on a reply...