문제

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

도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top