Search code examples
episerver

Episerver: hide a content type from showing up in the list of available blocks for main content area?


In Episerver in the main content area if you click on "create a new block" you are shown a list of blocks that can be added into this main content area.

We have created a custom block which I would like to hide from this list so that editors cannot see it.

Custom Block:

namespace Test.Site.Models.Forms
{
    [SiteImageUrl]
    [ContentType(GUID = "c9f294a0-6620-47c3-98fd-123f0fd8db8c")]
    public class CalculatorFormBlock : BaseTestCustomFormContainerBlock<GatedContentSuccessMessageBlock>
    {

    }
}

Is there a default method in Episerver to do this?


Solution

  • You can use AvailableInEditMode property (set it to false) of ContentType attribute to completely hide it from editing (also available as a checkbox in admin UI).

    More details in episerver documentation.