Display the contents of subfolders in the Plone folder view

On Plone website with structure

root +-topic1 | +-page1 | +-page2 | +-topic2 +-page3 +-page4 

I want to have a view for the root folder, which lists the contents of subfolders, for example:

 [http://host/plone/root/] TOPIC1 - page1 - page2 TOPIC2 - page3 - page4 

with "TOPIC1" and "TOPIC2" as headings and "page1", etc., linking to actual pages.

Just using a collection that combines pages in the folders topic1 and topic2 is not enough, since it does not create subheadings.

I searched the Plone product repository, as well as the web, for an extension that provides this view, without success. There are sources saying that this can be done with custom display types, but since I'm new to Plone, I hesitate to figure it out.

Is there a Plone product / extension that can provide such a view for the contents of a subfolder?
Or is there even a built-in solution that I don’t know about?

+6
plone
source share
3 answers

I get it.

Basically, you want to expand the folder_summary_view template to include a list of contents for the folder and collection items.

  • Create a copy. In ZMI, go to portal_skins/plone_content/folder_summary_view and click Configure. Go to the copy in portal_skins/custom/folder_summary_view and rename it (for example) list_contents .

  • Activate it as a folder view. Go to portal_types/Folder and manually add list_contents to the list of available viewing methods.

  • Make sure that only folders and collections are displayed in the view. Wrap the code that generates the record information in <tal:general_check condition="python: item_type in ('Folder', 'Topic')"> GENERATE ENTRY </tal:general_check>

  • Add code to list the contents of the element. You can steal it with portal_skins/plone_content/folder_listing as this already does what is needed. Copy the <metal:listingmacro> ... <metal:listingmacro> , but replace the folderContents definition in <tal:foldercontents> with this line to get the contents:

 folderContents folderContents|nothing; folderContents python:item_object.queryCatalog(**contentFilter) or item_object.getFolderContents(contentFilter, batch=True, b_size=limit_display or 100); 

(all in one line)

Note: item_object is the name assigned to the item in the external listing.

If you activate list_contents as a folder view now, it will work exactly as required in the question.

Disclaimer: This is a hacked copy of the paling by a novice Plone who works for me β„’. Use at your own risk.

+3
source share

You can also achieve this only through the Plone-UI:

Install Products.ContentWellPortlets and assign two collectible portlets under the content to your default view-item portal (for example, the "front-page" by default).

+2
source share

You can use the collection here, with two paths configured as criteria. And if you want, you can use this collection as the default view for "root". Browse the default news and events folders and collections located in it.

http://plone.org/documentation/manual/plone-4-user-manual/using-collections/adding-collections

0
source share

All Articles