Display Topic Results In Navtree
This tutorial shows you how to make topics in the navigation work like ordinary folders, which means:
You have a topic with several items (which are in different folders across the site). The topic naturally appears in your navigation tree. But if you are currently viewing e.g. a document inside a topic, you normally don't see any relation to the topic in your navigation.
With this HowTo you can make it apear as a sub-entry of your topic in the navigation (just as if the topic were a folder and your Document were located in it). This allows you to structure your site with topics while still having a good usability in your navigation.
In addition it re-enables the display of topic-results in the navtree for a currently viewed topic, even if showFolderishSiblingsOnly is activated (which was possible in Plone 1.0 but is not in Plone 2.0)
Please note: For this to work, it's necessary to modify a file in Products/CMFPlone on the filesystem. This is not recommended practice, but in this case it would be very difficult to avoid it. Use at your own risk, and keep backups. Also note that if you upgrade Plone, your changes will be overwritten.
- Add an integer-property with name
topicBatchSizeto your navtree_properties (located in your portal_properties) - Add this script to your custom-folder and give it the id
navigation_tree_builder_transline. - Insert the following lines in your StatelessTree.py, at the end of the function
def __call__(self)before thereturn resstatement - delete the line-breaks except after the first line (the comment). This file is located in Products/CMFPlone:#next lines included by transline for special navigation_tree_builder_transline res = context.navigation_tree_builder_transline(res,self.tree_root, self.checkPublished,self.childFinder,self.includeTop, self.showFolderishSiblingsOnly,self.showFolderishChildrenOnly, self.showNonFolderishObject,self.forceParentsInBatch, self.skipIndex_html,self.bottomLevel,getattr(self,'idsNotToList',[]), self.batchSize,self.navBatchStart,navtree_properties)
Attention: Afterwards you will need the navigation_tree_builder_transline in your custom-folder or elsewhere in your path, otherwhise you'll get an error!
- Restart Zope
- Activate the checkbox showTopicResults in your navtree_properties (located in your portal_properties in ZMI)
- That's it!
(Thanks to transline - Übersetzungsdienst für technische Übersetzung for coding this at working-time!!! - Meanwhile http://www.transline.de/ is based on Plone and this howto is working practice on this site as well as on Steinbeis Transferzentrum für Wissensmanagement & Kommunikation!)

Author: