Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
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?