November Happy Hour will be moved to Thursday December 5th.

Search option for select content popup in CMS edit

Vote:
 

Hi,

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

[UIHint(UIHint.Image)]
public virtual ContentReference DefaultWhiteLogo { get; set; }

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

Thanks,

Suresh B

#223128
May 19, 2020 17:25
Vote:
 

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):

[UIHint("wastebasket")]
public virtual PageReference DeletedPageLink { get; set; }
#223166
May 20, 2020 13:18
Vote:
 

Hi Jake Jones,

Thanks for the information. It worked.

Thanks,

Suresh B

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