Use Queries for Homepage Mini Gallery

Topics: Customizing Orchard
Jun 4, 2012 at 8:57 PM

Hello,

I am fairly new to Orchard, and I am currently customizing my own theme. So far it's been good, but I am interested in how do I set up query called "SubFeaturedRepairs" that is sorted randomly, and just displays four thumbnails horizontally. I want to be able to add more than four, but the page renders only four at a time.

Using Image Gallery was an idea, but I didn't find anyway of to set it up with only one row and never extends beyond four images.

I would appreciate if someone can share their expertise on queries to do this, unless I am mistaken.

Thank you.

Coordinator
Jun 4, 2012 at 9:14 PM

You could create a Gallery Image custom content type, with a Media Picker field, then create a Query to select those images randomly, and a Projection Widget to render the result.

Jun 4, 2012 at 9:38 PM
Edited Jun 4, 2012 at 9:51 PM
sebastienros wrote:

You could create a Gallery Image custom content type, with a Media Picker field, then create a Query to select those images randomly, and a Projection Widget to render the result.

Ah ha! Thank you. I don't know I created a query and made it display the picture in the best way, however, I got one displayed.

One other question, I am trying to only display the picture. For some reason, I have the URL displayed on top of the images. How do I remove when I don't see any property regarding displaying any URL?

Coordinator
Jun 4, 2012 at 9:52 PM

In theory you should just have the url. Overriding the template for this field should do it. Or you can use a Replacement Text in the layout property, by using {Content.Fields.YOURTYPE.YOURMEDIAPICKERFIELD.Url.Absolute}

Jun 5, 2012 at 4:37 PM

I want to thank you, and I found that I didn't need to use the Media Picker field. Just a content type.