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!

Current content for PropertyList item selection factory


When attaching a SelectOne or SelectMany attribute to a POCO object property being edited as part of a PropertyList property, the ExtendedMetadata object only contains the POCO object. The Model property is null, and it seems there's no way of getting the current content being edited, i.e. the current IContent object.

public IEnumerable GetSelections(ExtendedMetadata metadata)
        var currentContent = metadata.FindOwnerContent(); // This is null

I briefly had an idea of getting the current content by parsing the URL, but since the URL is for the selection factory store, that doesn't help me much - that URL doesn't contain any information about the current content context.

Any bright ideas? :)

Jan 20, 2016 23:23

That is basically what is done in the FindOwnerContent method. I don't think it works for PropertyList

Jan 21, 2016 10:22

Thanks, Marija! I'm not sure that works, though?

It would normally, but when editing a PropertyList item (i.e. a POCO object) the selection factory REST store request simply includes the name of the selection factory type - there is no content context information.

That code sample could be replaced with the FindOwnerContent extension method, but regardless I still get null back. :/

Edit: Right, like Per said. :)

Edited, Jan 21, 2016 10:23


Old thread, I know! But... did you ever find a soloution for this? I'm running into the same problem :)

Jan 23, 2018 11:32

If you have latest version of Epi and it still doesn't, it sounds like it should be reported as a bug to Episerver support. I couldn't find a bug report, see this.

Jan 23, 2018 11:51

I got this answer from Episerver today 2018-06-19

"We're developing a story that will fix this issue. The story will be released in CMS UI 12 that requires some breaking changes."

Jun 19, 2018 10:49

I'm into the same problem. Is there any alternative solution to it? 

May 07, 2021 11:36
Praful Jangid - May 10, 2021 12:36
What is your CMS UI version?
sp - May 10, 2021 13:25
Hi Praful, Thanks for your response. I'm using EPiServer.CMS.UI - 11.30.0.

OK, I managed to fix this.
Solution would be available in CMS UI 11.36.2
Stay tuned!

Available here:

Edited, Sep 15, 2021 11:10
- Aug 30, 2022 11:09
So how did you fix this? There is no CMS UI 11.36.2, and 11.36.10 does not do anything to resolve this. Also, your link points to version 12.0.2 of CMS UI, which is running .net core and is not compatible with EPI 11 projects.

For the property edit mode on a block, current contentlink can be retrieved from like so in the GetSelection method:

var currentContentLink = EPiServer.Core.ContentReference.Parse(HttpContext.Current.Request.Headers["x-epicurrentcontentcontext"]);

This however will not work in the quick-edit dialog, the x-epicurrentcontentcontext header will there instead contain whatever content you were on before opening the quick-edit dialog.

Aug 30, 2022 12:11
* 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.