This project is read-only.

Image Randomizer in Aside Zone on Page Refresh

Topics: Customizing Orchard, Writing modules
Aug 19, 2013 at 9:07 PM

I'm using the Bootstrap theme and, for applicable pages, looking to use a widget on the AsideSecond zone that randomizes an array of images on each refresh.

I'm curious what people recommend is the best way to do this. jQuery? Internally in Orchard? Something on the server side?

Any tips would be appreciated.

Aug 20, 2013 at 5:11 PM
Edited Aug 20, 2013 at 5:12 PM
So I've adapted the steps here: to create a Gallery Image custom content type with a Media Library Picker Field.

I created a Query to select those images randomly, with the details being:

Filters: Content with type GalleryImage \ Gallery Image.Image contains '{Content.Fields.GalleryImage.Image}'
Sort Criteria: Random Order
Layouts: none

and then placed Projection Widget on the Aside Second to render the result.

However the image does not display. There is an "Edit" function atop the widget (similar to when I preview the Query) as I have the Content Control Wrapper module enabled; so something is being rendered...just not the image.

I'm thinking the solution is in the Query's filter, but not sure where. Please let me know how to render the images.