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

Vote:
 

Hi,

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

http://joelabrahamsson.com/limiting-content-and-page-reference-properties-to-values-of-a-specific-type-in-episerver-cms/

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:

[ContentSelection(typeof(MyBlock))]
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

#206437
Edited, Aug 21, 2019 11:14
Vote:
 
#206438
Edited, Aug 21, 2019 11:17
Vote:
 

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?

#206439
Aug 21, 2019 11:30
Vote:
 

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

#206440
Aug 21, 2019 11:40
Vote:
 

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

#206441
Aug 21, 2019 12:01
Vote:
 

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

#206444
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.