Prevent certain types from appearing in folder lists in plone.app.theming

I have a website that has a public url displayed through the plone.app.theming / Diazo theme and a url limited to content editors displayed via sunburst.

I would like certain types of portal to be displayed only in lists by cms editors, and not on a public site. I noticed that the folder_listing template uses request/contentFilter, if defined. Is there a way to add a content filter to a query for a topic view only?

+3
source share
1 answer

, Plone. , , , .

def SetupThemeView(site, before_traverse):
    """ If we're serving the public, themed, version then supplement the request
    """
    request = before_traverse.request
    if serving_theme_view(request):
        request.set('contentFilter', {'portal_type' : listable_types})

serving_theme_view , , listable_types - , .

configure.zcml

<subscriber
    for="Products.CMFCore.interfaces.ISiteRoot
         zope.traversing.interfaces.IBeforeTraverseEvent"
    handler=".events.SetupThemeView"
    />
+1

All Articles