More in this section

Forums / Developing with Sitefinity / Querying Image Library returns two copies of image

Querying Image Library returns two copies of image

4 posts, 0 answered
  1. Jon Ingersoll
    Jon Ingersoll avatar
    32 posts
    Registered:
    12 May 2009
    09 Dec 2011
    Link to this post
    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
  2. Tim
    Tim avatar
    258 posts
    Registered:
    22 Jun 2011
    09 Dec 2011
    Link to this post
    Jon,

    Try this for the status:

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

    Hope that helps!
  3. Jon Ingersoll
    Jon Ingersoll avatar
    32 posts
    Registered:
    12 May 2009
    12 Dec 2011
    Link to this post
    Actually, what I posted worked perfectly, however one needs to add it to the correct usercontrol in order for it to show results ;)
  4. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    13 Dec 2011
    Link to this post
    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
4 posts, 0 answered