Querying Image Library returns two copies of image

Posted by Community Admin on 04-Aug-2018 22:14

Querying Image Library returns two copies of image

All Replies

Posted by Community Admin on 09-Dec-2011 00:00

We have a custom image slideshow on our site that reads the images out of an image library. We are currently getting two copies of the images rotating in the slide show. One will be 1.jpg the other will be 1.jpg?Status=Master.

My investigations on the forums leads me to believe that this is due to workflow. I tried modifying the query that pulls the image to:

IList allImages = libManager.GetImages().Where(i => i.Album == album && i.Status != Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live).OrderBy(o => o.Title).ToList();

To restrict anything but the fully published copy, but that still returns the same two images.

-Jon

Posted by Community Admin on 09-Dec-2011 00:00

Jon,

Try this for the status:

i.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live

Hope that helps!

Posted by Community Admin on 12-Dec-2011 00:00

Actually, what I posted worked perfectly, however one needs to add it to the correct usercontrol in order for it to show results ;)

Posted by Community Admin on 13-Dec-2011 00:00

Hmm... but still you are not showing the 'live' version of your images. Your function is loading all images except the live versions :)
Regards,
Daniel

This thread is closed