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

Peter Simmons cabbiepete at gmail.com
Tue Mar 4 12:35:20 UTC 2008


Hi Gordon,

I haven't done this in plone 3 yet (so someone may contradict me about it)
but that is the file you are after for the sub macro.

I know there is a plan to remove that dependency so that the data and
templates are more easily overridden indpendantly but it sounds as though
this didn't make it yet.

Hope that helps.

Pete

On 03/03/2008, Gordon Anderson <gordon.b.anderson at gmail.com> 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
>
>


-- 
Pete
irc: cabbiepete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-ui/attachments/20080304/eb07f632/attachment-0001.html>


More information about the UI mailing list