Don't miss out Virtual Happy Hour this Friday (April 26).
Try our conversational search powered by Generative AI!
AI OnAI Off
Don't miss out Virtual Happy Hour this Friday (April 26).
What about following code?
var contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();
var helper = ServiceLocator.Current.GetInstance<ContentAssetHelper>();
var folder = helper.GetAssetFolder(CurrentPage.ContentLink);
var images = contentRepository.GetChildren<MediaData>(folder.ContentLink);
That probably works. I ended up with the following lines of code:
var contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();
var contentAssetFolder = contentRepository.Get<ContentAssetFolder>(page.ContentAssetsID);
images = contentRepository.GetChildren<
ImageFile>(contentAssetFolder.ContentLink);
Pardon for the unformatted code. How do I go about pasting the code with its original formatting?
//Daniel
I'd like to fetch all images belonging to a page from code. Is that feasible in Episerver 7.5 via the blobfactory?