I posted this developers list but was told to post it over here instead...

I have my navigation menu set up to only display the contents of the current
folder.  When you view a folder that is empty the navigation portlet
dissappears.  Normally, this isn't a big deal but it becomes a big problem
if you set a Smart Folder as a the default view on a folder.

When you first enter a folder with a Smart Folder as the index, the
navigation sees the Smart Folder as "folderish" and tries to display the
contents of the Smart Folder.  If you have no "subtopics", then there's
nothing to display in the navigation.  However, I'm trying to use the Smart
Folder to display the contents of the folder in a particular order and have
the items in same folder appear in the navigation.  I've narrowed it down to
a relatively simple "fix", but I need a little help on the exact coding...

in Products/CMFPlone/browser/navigation.py there is the following code:

   def navigationTreeRootPath(self):
       context = utils.context(self)

       portal_properties = getToolByName(context, 'portal_properties')
       portal_url = getToolByName(context, 'portal_url')

       navtree_properties = getattr(portal_properties,
'navtree_properties')

       currentFolderOnlyInNavtree =
navtree_properties.getProperty('currentFolderOnlyInNavtree', False)
       if currentFolderOnlyInNavtree:
           if context.is_folderish():   # ... and not empty
               return '/'.join(context.getPhysicalPath())
           else:
               return '/'.join(utils.parent(context).getPhysicalPath())
  # ...SNIP...

 I would like to add to the "if context.is_folderish()" line an "and not
empty".  That way, if viewing only the current folder is selected, then
empty folders will have the parent folder listings displayed instead of just
dissappearing.  How do I do this?  Is it possible in this context?

 -Tim
-- 
View this message in context: 
http://www.nabble.com/navigation-dissappears-on-empty-folder-workaround--tf3909594s20094.html#a11085353
Sent from the Product Developers mailing list archive at Nabble.com.


_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to