Plone 3: Showing 'default pages' in the navigation portlet

by Matt Sital-Singh on Dec 19, 2008
Filed Under:

The simplest way I've found so far, which is not as simple as it should be, is as follows:

1. Add a getCustomNavQuery method to your folderish content type(s). If you don't have a custom folder type, you may just be able to create a python script which works globally (I haven't tried this). The method should read as follows:

   def getCustomNavQuery(self):
       return {'is_default_page': [True, False, None, ],
               }

This will make default pages appear in the default navigation portlet. Unfortunately, at this stage they will never have the 'selected' style.

2. To give default pages the selected style, you need to override/extend the default navigation portlet. I won't detail how to do this here, but the only part of it you need to customise is the page template 'navigation_recurse.pt'.

In this file, you will find a bunch of definitions at the top. You need to replace this line:

is_in_path      node/currentParent;

with this:

is_in_path      python: node['currentParent'] or (item_url in request.get('URL0', None));

That should work. If it doesn't, I'm sorry.

Filed under: , ,

Commenting has now closed on this post.

Follow us

— via Twitter

Is proudly sponsoring #BlueLightCamp today. If you want to come talk Open Source content management @HammerToe is there #blcamp
last month