New "Content Query" Module

Topics: Administration, Announcements, Customizing Orchard, General, Writing modules
Jul 12, 2011 at 5:30 PM

Hey all, I was wondering if some people could try out a module I've been working on before I push it up to the gallery.  Basically it allows you to create a "content query" page or widget.  Think of it as a list, but instead of having to add items to the list, you can define criteria for what items will show up on that list (i.e. what type of content it is, what the container is, what tags it has, etc).  The filtering providers and sorting providers are extensible, so you can add custom filters/sort providers as needed.  Here are a couple screenshots to give you an idea of what I'm talking about: http://i.imgur.com/xqhR2.png (page) http://i.imgur.com/V7j7r.png (widget).

Please give me feedback and I will add it into the gallery.

It depends on this module (a field for selecting a content type)

http://dl.dropbox.com/u/563147/Orchard.Module.SchoolPointe.ContentTypeField.1.0.nupkg

Here's the module package:

http://dl.dropbox.com/u/563147/Orchard.Module.SchoolPointe.ContentQuery.1.0.nupkg

Coordinator
Jul 12, 2011 at 6:20 PM

Another approach could be to have a list of Queries, and you can create a Query Page or a Query Widget, just by selecting one by name. You could then be able to clone queries, or create sub queries.

Jul 12, 2011 at 8:17 PM

Sebastian - are there any things you can think of off the top of your head that would be useful to be able to query on?  I put tags in there because I feel like I've seen about 1,000 people ask how to filter a list by tags.

Sep 23, 2011 at 8:50 AM
sebastienros wrote:

Another approach could be to have a list of Queries, and you can create a Query Page or a Query Widget, just by selecting one by name. You could then be able to clone queries, or create sub queries.

Hi, I have just a similar need.

I'm developing a product catalog site, so I have to display lists of products for a certain category (that I've implemented as a taxonomy) or lists of products filtered by some of the product fields.

Example: all products for men, or all products for the winter season. These fields (gender, and season) are in a custom ProductPart record I've developed, following the SampleCommerce sample.

The built-in list feature in orchard, would require users to manually add items to the list, but its unmanageable because every change to a product would require a change in all the affected lists.

So I would like to define a dynamic list, or queries as Sebastien said.

Do you have any hints/advice about how to achieve this?

Sebastien, I've read that Orchard 2.0 will have a commerce module, so I guess you are working on how to create pages whose content is retrieved by queries: any glance about the direction you have taken would help me a lot.

Thanks.

Coordinator
Sep 24, 2011 at 1:01 AM

Yes, we have started to work on it already. It should be the next priority after v1.3

Sep 24, 2011 at 9:00 AM

Glad to hear it, but unfortunately my deadline is sooner than v1.3.

I know how to do it with a custom mvc site, but I would like to integrate it into the Orchard architecture.

Could you please give me any advice about how to implement this with current version of Orchard?

Thanks.

Coordinator
Sep 24, 2011 at 9:12 AM

Just build your own controller. There are plenty of examples, like blog.