views:

171

answers:

2

I'm pretty new to querying in plone, and I was wondering what's an efficient way to return just images on the site using a catalog query, and searching by type. I don't want to have to restrict users to a given folder if I don't have to.

I tried:

catalog(object_provides="Products.ATContentTypes.interface.image.IATImage", 
                    review_state='published',
                    sort_on='sortable_title')

but what it returned included pages, simpleblog pages and such (I assumed b/c those documents can have images in them, and therefore implement IATImage)

Much appreciated

A: 

Ok, found it. I rather than object_provides, I had to use portal_type=='image'

Paul
A: 

To clarify, it's

catalog(portal_type="Image", 
                    review_state='published',
                    sort_on='sortable_title')

Took me a few minutes of Googling before I realized you have to capitalize 'Image'. Also, it's just a single equals sign.

kevinharvey
Thanks, that's more correct than what I'd put up.
Paul