Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Adriano Fabri 469 posts 1633 karma points
    May 15, 2024 @ 08:19
    Adriano Fabri
    0

    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

  • Jamie Townsend 62 posts 285 karma points c-trib
    May 21, 2024 @ 14:13
    Jamie Townsend
    1

    Hi there, you could/should be able to do this via SendingContentNotification documentation is here https://docs.umbraco.com/umbraco-cms/reference/notifications/editormodel-notifications

  • Adriano Fabri 469 posts 1633 karma points
    May 21, 2024 @ 21:21
    Adriano Fabri
    0

    Hi 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

  • Jamie Townsend 62 posts 285 karma points c-trib
    May 22, 2024 @ 11:13
    Jamie Townsend
    0

    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.

  • Jamie Townsend 62 posts 285 karma points c-trib
    May 22, 2024 @ 12:01
    Jamie Townsend
    2

    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.

    enter image description here

    Credit to Callum Whyte as this is essentially the same as he's showed in his fantastic talk 'Block to Basics'

Please Sign in or register to post replies

Write your reply to:

Draft