malsup / cycle2

2nd gen cycling
899 stars 236 forks source link

Using jquery cycle2 - how to put slides in certain order #707

Open tdrew0915 opened 9 years ago

tdrew0915 commented 9 years ago

Hello,

I've inherited some code for a sharepoint page which is using the cycle2 js with cycle overlay and some javascript to pull the image information (title, imagename, description, etc.) from a sharepoint picture library. I can't seem to find out how to show the images in a certain order using the slideshow. Anyone have any ideas on this?

Thanks

paulfecht commented 9 years ago

When you are retrieving the images from the SharePoint Picture library, in this case I'll assume you're using javascript, build a caml query that will retrieve the title,

var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml("<View />");
    var qitems = list.getItems(camlQuery);

    var items = context.loadQuery(qitems, "Include(Title, FileRef)");

then just make sure you title the slides(i.e. the images) in the library with names like slide-1.jpg, slide-2.jpg . . . etc. When they are retrieved they will be in the order of 1,2,3 . . . etc. When the slideshow is created they should be in order.