Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

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

Vote:
 

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?

#199423
Nov 27, 2018 10:13
Vote:
 

I found this.

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

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

var linkedContent = contentSoftLinkIndexer.GetLinks(content);

#199424
Nov 27, 2018 10:58
Vote:
 

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.

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