[Product-Developers] Re: Exposing pseudo content objects to the standard nav tree

Martin Aspeli optilude at gmx.net
Sat May 10 20:12:34 UTC 2008


Gilles Lenfant wrote:
> Hi,
> 
> I made a content type that uses an XML bunch. Parsing that XML bunch  
> makes a tree of volatile subobjects.
> 
> Till then this is pretty classical and easy and fast (thanks to lxml).
> 
> To navigate across those subobjects, I could make a portlet and tweak  
> the URL traversal rules of that content type. But I need to include  
> the inner subobjects navigation into the standard navigation portlet.
> 
> As the subobjects are far to be 1st class plone objects and not  
> indexed (and will never be indexed) I'm somehow stuck to achieve this.
> 
> Cloning these subobjects to persitent classical content tree is not an  
> option for me.
> 
> (badly?) Grepping the source code involved in navigation logic didn't  
> show interfaces and adapters for such situation. Am I missing something?

The navigation tree algorithm uses a INavtreeStrategy (looked up as a 
multi-adapter by the navtree portlet) to make decisions about how the 
navigation tree looks. It should be possible to use its "decorate node" 
function to add new children that don't actually exist. You may need to 
create a simple class that acts as a catalog brain and stick this under 
the 'item' key of each node for this to work.

Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book





More information about the Product-Developers mailing list