Try our conversational search powered by Generative AI!

Find content ID of the page a page assets folder belongs to


When a new media is added we need to identify if this media item is part of a page assets folder and if it is we would like to get the content ID of this page.

We hook onto the PublishedContent-event to identify when a media file is added and form this we can probably find the assets folder by recursively calling ParentLink, but we have not found any way to identify which page this folder belongs to.

How can I find the page ID for a page folder?

Is there a better way of getting the page assets folder for a media file other than the recursive calls for ParentLink?

Mar 11, 2014 14:20

I think that ContentAssetFolder.ContentOwnerID should contain reference to page or block to which it's "binded" (attached).


Mar 11, 2014 19:54

Thanks Valdis, that seemed to do the trick!

ContentOwnerID seems to return an content guid. I used PermanentLinkMapStore.Find(Guid guid) as PermanentContentLinkMap to get the ContentReference to the page

Mar 12, 2014 11:45

Permanent link map always remind me of some *low* level stuff I have to deal :)

What about content resolver?

var resolver = ServiceLocator.Current.GetInstance<IContentResolver>();
var ref = resolver.ResolveContent(guid);


Mar 12, 2014 11:55

Aah, even better! :) Thanks again, Valdis!

Mar 12, 2014 12:09
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.