Search option for select content popup in CMS edit



I need to show search option for content pages in "Select Content" popup for editors. I have below few page type properies across the application.

1) public virtual ContentReference ProductPage { get; set; }

2) public virtual IEnumerable<ContentReference> Industries { get; set; }

Editors are facing difficulties to identify the required page to map becuase sometimes editors has to go multiple level of tree structure to map it.

For media files, we are getting search option. Below is the sample example

public virtual ContentReference DefaultWhiteLogo { get; set; }

Can you please someone assist to get search option "Select Content" for content pages as well?


Suresh B

May 19, 2020 17:25

Hi Suresh,

Unless I misunderstand the question, you can just do:

public virtual PageReference ProductPage { get; set; }

Its also possible to restrict the root which editors can select pages under, to do this you just need to add an editor descriptor. As an example, here is one that would limit them to selecting an item in the trash:

[EditorDescriptorRegistration(TargetType = typeof(PageReference), UIHint = "wastebasket")]
public class WasteBasketPageReferenceEditorDescriptor : PageReferenceEditorDescriptor
	public override IEnumerable<ContentReference> Roots => new List<ContentReference> { ContentReference.WasteBasket };

It's then just a case of using a UI Hint (as per your example):

public virtual PageReference DeletedPageLink { get; set; }
May 20, 2020 13:18

Hi Jake Jones,

Thanks for the information. It worked.


Suresh B

May 21, 2020 17:47
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.