On Mon, 2006-06-12 at 00:57 +0300, Ilias Lazaridis wrote:
> Matthew Good wrote:
> > On Mon, 2006-06-12 at 00:18 +0300, Ilias Lazaridis wrote:
> >> Emmanuel Blot wrote:
> ...
> >>> If you want to add a new item to the metanav bar, create a plugin that
> >>> implements the INavigationContributor interface, and implements the
> >>> interface methods:
> >>>
> >>>    # INavigationContributor methods
> >>>    def get_active_navigation_item(self, req)
> >>>    def get_navigation_items(self, req)
> >>>
> >>> Have a look at Settings.py for example.
> >>>
> >>> There is an option in trac.ini to change the order of appearance (left
> >>> to right) of the main nav item, I'm not sure if such an option exists
> >>> for metanav.
> >> thanks for the overview.
> >>
> >> the metanav is like iron, I cannot alter it via INavigationContributor.
> >>
> >> mainnav can be altered fine.
> > 
> > Both nav sections are provided by the same API.  See trac.Settings for
> > an example of providing metanav items:
> > http://projects.edgewall.com/trac/browser/trunk/trac/Settings.py?rev=3030#L31
> 
> They do not behave the same, as said, metanav cannot be altered:
> 
> You can test it with this code:
> 
> class MetanavChange(Component):
>      implements(INavigationContributor)
> 
>      # INavigationContributor methods
>      def get_active_navigation_item(self, req):
>          return ''
> 
>      def get_navigation_items(self, req):
>          yield 'mainnav', 'search', Markup('HELLO')
>          yield 'metanav', 'logout', Markup('HELLO')

Well, 'search' and 'logout' are names used by the built-in Trac
components, so you shouldn't use them as identifiers for your custom nav
items.  Both nav items showed up when I gave them new identifiers.

-- 
Matthew Good <[EMAIL PROTECTED]>

_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac

Reply via email to