Ticket #10169 (confirmed Feature Request)

Opened 6 years ago

Last modified 4 years ago

make folder_listing folder_summary_view with custom topics too

Reported by: frisi Owned by:
Priority: minor Milestone: 4.x
Component: Templates/CSS Version: 4.0
Keywords: Cc:

Description

folder_summary_view, folder_listing etc currently only work for topics with portal_type "Topic" If on creates a new type based on topic all of the topic default views need to be customized in order to work properly.

instead of checking for the portal type explicitly as its done atm

folderContents python:context.portal_type=='Topic' and context.queryCatalog(contentFilter, batch=True) or context.getFolderContents(contentFilter, batch=True, b_size=limit_display or 100);

we could use some new view (possible something like this already is part of plone's infrastructure) to test whether the current context provides a certain interface

  iface_view context/@@ifaceCheck;
  isTopic python:iface_view.contextProvides('Products.ATContentTypes.interfaces.topic.IATTopic')
  folderContents python:isTopic and context.queryCatalog(contentFilter, batch=True) or context.getFolderContents(contentFilter, batch=True, b_size=limit_display or 100);

which makes customizing the views unnecessary

risks: possible performance implications (looking up the view and check for the interface)

Change History

comment:1 Changed 6 years ago by kleist

  • Component changed from Unknown to Templates/CSS

comment:2 Changed 4 years ago by kleist

  • Status changed from new to confirmed
  • Version set to 4.0

Still an issue with plone.app.collection?

comment:3 Changed 4 years ago by frisi

as long as folder_contents.pt checks for a portal type rather than an interface the problem will remain:

 https://github.com/plone/Products.CMFPlone/blob/4.2/Products/CMFPlone/skins/plone_content/folder_listing.pt#L35

Note: See TracTickets for help on using tickets.