Searching the catalog from a portlet in Plone 5

I am making a (slideshow) portlet for Plone 5.

How can I search the catalog 'from the portlet?
I have given it quite a few tries, and used syntaxes that I think worked in Plone 4:

Is the 'renderer' the right place to define things ?
( https://github.com/espenmn/spacetheme/blob/master/medialog.spacetectheme/src/medialog/spacetectheme/portlets/sliderportlet.py#L88 )

There is no difference between Plone 4 and 5 if it comes to portlets.

Renderer is perfectly fine.

Just don't pass non-existing query keys, like sorton and sortorder (missing underscore) otherwise result is empty.

Edit: And don't kill the performance by doing image.getObject() for all results,

1 Like

You may look at how the news portlet does it:

thans a lot (it's up and running )
I noticed that some 'portlet products' use syntax like

def getitems(self):

and some use 'data', as the news portlet
Does this matter
(except from using view/data/something in portlet.pt instead of view/something)

The attributes from data come from the Assignment class, which in turn implements the portlet schema as defined by its Interface (INewsPortlet). So, data gives you the fields editable by the end user.