SaaS CMS has officially launched! Learn more now.

Find out which MediaData that is referenced from a page/block


There's this method in IContentRepository

_contentRepo.GetReferencesToContent(mediaData.ContentLink, false)

That will let me know if there's content (pages/blocks) that is using the MediaData in someway.

What about the other way around?

Is there a generic way of finding out which MediaData that is referenced by a specific page/block?

Nov 27, 2018 10:13

I found this.

Note that it is marked as "Unsupported INTERNAL API!"

var contentSoftLinkIndexer = ServiceLocator.Current.GetInstance<ContentSoftLinkIndexer>();

var linkedContent = contentSoftLinkIndexer.GetLinks(content);

Nov 27, 2018 10:58

Hi Peter,

I'd suggest that, rather than use an internal API you could use IContentSoftLinkRepository. That has a "load" method which lets you retrieve a list of content linked from a given piece of content.

Nov 27, 2018 11:58
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.