Hide Blocks in Umbraco - New package released

I’ve released Hide It, a small Umbraco package that adds a hide/show button to Block List and Block Grid, making it easy to temporarily hide content without removing it. :partying_face:

You can find it on the marketplace here: Hide It | Umbraco Marketplace

It also supports nested blocks and automatically filters hidden blocks from the frontend.

Supported versions: Umbraco 17.5+ and 18+.

Feedback and ideas are very much appreciated! https://github.com/andreaslborg/HideIt

Cool!
We’ve considered similar functionality in the past but did not go through with the efforts yet with the concern for indexing and how such blocks should be handled within search.
Friendly heads-up on the consideration :wink:
Looking forward to checking it out because there are definitely good use cases for such a package.

Hi @pc-pdx,

Honestly, I haven’t thought of indexing.. That is a very good point.
I’ve added it to my todo, thanks for the heads-up :smiling_face_with_sunglasses:

Hi again @pc-pdx,

I’ve just fixed this and it will be included in the next version. Thanks for pointing it out! :high-5-you-rock:

In headless scenario’s, will the blocks also be filtered from the content delivery api output?

Hi @Luuk, great question.

I haven’t validated this in a full headless project yet, but based on the implementation it should also be filtered in Content Delivery API output.

HideIt registers custom implementations of Umbraco’s BlockListPropertyValueConverter and BlockGridPropertyValueConverter in DI, so filtering runs in ConvertIntermediateToObject(...) as part of Umbraco’s core value-conversion pipeline (before both Razor rendering and Delivery API serialization). That means API consumers should receive BlockListModel/BlockGridModel values already filtered to visible items.

// HideItComposer.cs
builder.PropertyValueConverters()
.Replace<BlockListPropertyValueConverter, HideItBlockListPropertyValueConverter>()
.Replace<BlockGridPropertyValueConverter, HideItBlockGridPropertyValueConverter>();

// HideItVisibilityBlockListFilter in HideItBlockFilters.cs
public BlockListModel Filter(BlockListModel model) => model.WhereVisible();

If you test this in a 17.5+ or 18 headless setup, I’d really appreciate hearing the result.