SaaS CMS has officially launched! Learn more now.

Episerver 11: Limiting content and page reference properties to values of a specific type in EPiServer CMS



Is there a way in Episerver 11 to get this working (the global variant):

After added all steps from the post I tried several things, but nothing seems to work.

I still get the default picker when I use:

public virtual ContentReference MyProperty { get; set; }

Also when I changed propertytype from ContentReference to string or changed the ContentSelector ClientEditingClass from "epi.cms.contentediting.editors.SelectionEditor" to "app/Editors/HtmlSelectionEditor".

Anyone else has the same problem or a solution?

Thanks in advance.

Grtz Sander

Edited, Aug 21, 2019 11:14
Edited, Aug 21, 2019 11:17

Hi Scott,

Thanks for your answer, but this is not what I'm really looking for.

I already known the usage of AllowedTypes, but I want a dropdown with blocks of a specific type to select.
So not dragging the block item to the ContentReference property, but select the block from a dropdown list containing all blocks of that type.

Hopefully it is more clear now?

Aug 21, 2019 11:30

I don't have the time to test this, but off the top of my head I think at the start of CMS 11 they changes all the JS types from . separation to kebab case (-).

I checked some of our code and it should be epi-cms/contentediting/editors/SelectionEditor as the client editing class

Aug 21, 2019 11:40

Hmmm...still no luck with this change...

Aug 21, 2019 12:01

I've just checked our code again.

Try also adding

[EditorDescriptor(EditorDescriptorType = typeof(ContentSelector))]

Above the property, you may need to remove the ContentSelection attribute. If I can get time I'll try and look in to it but I'm busy with a client project atm

Aug 21, 2019 12:56
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.