I'm trying to find all references to all images in all blocks.
var searchClient = ServiceLocator.Current.GetInstance<IClient>();
var result = searchClient.Search<IContent>()
.For(item.Name)
.GetContentResult();
The code above returns me pages where the image is in the properties, but I cannot find a way to find images in the nested blocks.
Is there another way? or any other ideas?
Performance is for now is not a problem.
Try
var referencedLinks = ContentRepository.GetReferencesToContent(item.ContentLink, false).Select(x => x.OwnerID);
var items = ContentRepository.GetItems(referencedLinks, LanguageSelector.AutoDetect());
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.