[Plone-UI] Skinning Navigation Portlet in Plone 3 - how do you override sub macros?

A Bowtell anne.bowtell at medsci.ox.ac.uk
Tue Mar 4 12:44:59 UTC 2008


I'm not sure that this is actually the template you need. Most of the new
portlet files are now in an egg:

plone/app/portlets/portlets

The file you need there is called navigation_recurse.

I asked a similar question a few months ago

http://www.nabble.com/Customising-navigation_recurse.pt-td13915256s6742.html#a13916403

Anne 

Gordon Anderson-2 wrote:
> 
> hi
> 
> I have successfully overridden the main navigation template using a stanza
> similar to this in configure.zcml
> 
>   *     <plone:portletRenderer
>        
> portlet="plone.app.portlets.portlets.navigation.INavigationPortlet"
>         template="templates/navigation.pt"
>         layer=".interfaces.MyIntranet"
>         />*
> 
> If I change the file navigation.pt I see the changes reflected in the web
> interface.  However inside this file there is a call which appears to
> render
> the entire navigation tree:
> 
> *            <li tal:replace="structure view/createNavTree">
>                 SUBTREE
>             </li>
> 
> *Removing the above does indeed remove the core of the navigation
> structure
> when viewed in a web browser.
> 
> 
> Now I am assuming this is a call to a method in *
> plone/CMFPlone/browser/portlets/navigation.py* - the method in its
> entirety
> is this
> *
>     def createNavTree(self):
>         context = aq_inner(self.context)
>         data = self.getNavTree()
>         properties = getToolByName(context, 'portal_properties')
>         navtree_properties = getattr(properties, 'navtree_properties')
>         bottomLevel = navtree_properties.getProperty('bottomLevel', 0)
>         return context.portlet_navtree_macro(
>             children=data.get('children', []),
>             level=1, show_children=True, isNaviTree=True,
> bottomLevel=bottomLevel)*
> 
> The only reference I can find to a file called *portlet_navtree_macro* is
> in
> *CMFPlone/skins/plone_deprecated/portlet_navtree_macro.pt* - is this the
> correct file, as I note its in the deprecated folder.
> 
> And secondly - how do I go about overriding this file, as I wish to make
> changes in the navigation tree code.
> 
> Thanks
> 
> Gordon
> 
> _______________________________________________
> UI mailing list
> UI at lists.plone.org
> http://lists.plone.org/mailman/listinfo/ui
> 
> 

-- 
View this message in context: http://www.nabble.com/Skinning-Navigation-Portlet-in-Plone-3---how-do-you-override-sub-macros--tp15824432s6746p15826397.html
Sent from the User Interface & Design mailing list archive at Nabble.com.





More information about the UI mailing list