Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Get ContentData of a current editing page on Edit mode.


I'm creating a custom selection factory which renders options base on another property value of current editing page. 

Does Episerser has any API can get ContentData of  current editing page or any extension can extract Page ID from edit mode URL?



I would like to get value 1774 from param "epi.cms.contendata"

Thanks for your help.

Oct 19, 2018 11:17

Hi Thien,

You can reference the ContentData of the content which is using the SelectionFactory by casting the ExtendedMetadata object passed in to the GetSelections method as ContentDataMetadata and accessing the OwnerContent property.

public IEnumerable<ISelectItem> GetSelections(ExtendedMetadata metadata)
    var myContentData = (metadata as ContentDataMetadata)?.OwnerContent;
    // Do stuff here

Bear in mind though that, depending what you're doing with it, selection factories are generally populated once when the editor loads and so it won't reflect changes made in the course of editing the rest of the page.

Oct 19, 2018 20:19

thank Paul, but your code always returns null when casting. Do you have any other idea?

Oct 22, 2018 12:54

My problem is PropertyList :( lol

Oct 22, 2018 13:05
* 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.