def get_navigation_items(self, req):
yield 'projnav', 'guide', html.a( 'Project Guide',
href=self.env.href.wiki('ProjectGuide') )
}}}
crashes within source:/trunk/trac/web/chrome.py, as there's no Option
"projnav_order" defined.
The attached patch enables that code without the need to define an Option.
This way, new custom navigation items can be generated dynamically,
without any modifications in the source code / ini-files.
--
Ticket URL: <http://trac.edgewall.org/ticket/3692>
The Trac Project <http://trac.edgewall.org/>
* owner: daniel => cboos
* severity: normal => minor
Comment:
A few (minor) remarks:
- in attachment:ChromeNavigationLinks.diff, you used a "catch all"
exception handler, which is generally a bad idea. Better be specific, in
this case catching `AttributeError` is enough.
- if you can, please directly provide us with a full-contained example
component, in this case something like:
{{{
#!python
from trac.core import *
from trac.util.html import html
from trac.web.chrome import INavigationContributor
class ProjectNavigation(Component):
implements(INavigationContributor)
def get_active_navigation_item(self, req):
return 'guide'
def get_navigation_items(self, req):
yield 'projnav', 'guide', \
html.a('Project Guide', href=req.href.wiki('ProjectGuide'))
}}}
Note also that you should get used to write `req.href` instead of
`self.env.href`, as the latter form is now deprecated and will probably go
away in [milestone:0.11].
As for the (fixed) patch itself, I'm +1 if you can show us how you intend
to make use of the non-standard navigation category (i.e. something else
than 'metanav' and 'mainnav').
--
Ticket URL: <http://trac.edgewall.org/ticket/3692#comment:1>
Well, if we're going to support custom navigation items then they should
probably support ordering as well. However, I don't want to keep pushing
back 0.10 for new features. Can we at least push this to 0.10.1 to get
some more information?
--
Ticket URL: <http://trac.edgewall.org/ticket/3692#comment:2>
Replying to [comment:1 cboos]:
> - if you can, please directly provide us with a full-contained example
component,
the code is located
[http://dev.lazaridis.com/base/browser/infra/TracX/tracx/menus.py here]
(corrected to use "self.env.href"):
> As for the (fixed) patch itself, I'm +1 if you can show us how you
intend to make use of the non-standard navigation category (i.e. something
else than 'metanav' and 'mainnav').
You can find an example usage here (menu below project title):
I'll attach a corrected patch.
--
Ticket URL: <http://trac.edgewall.org/ticket/3692#comment:3>
Replying to [comment:2 mgood]:
> Well, if we're going to support custom navigation items then they should
probably support ordering as well. However, I don't want to keep pushing
back 0.10 for new features. Can we at least push this to 0.10.1 to get
some more information?
* Custom navigation items '''are already supported'''. This patch removes
just a tiny defect (possibly I should have filed a "defect" instead of
"enhancement"), thus "custom navigation items" can be created again. This
patch can/should be applied now, as it corrects the defect behaviour of
the ordering-mechanism.
* See #3695: The ordering mechanism could be refactored in order to avoid
the necessity to hardcode the option within chrome.py. This should be
implemented later, as it changes behaviour and would possibly block the
0.10 release.
--
Ticket URL: <http://trac.edgewall.org/ticket/3692#comment:4>
* status: new => closed
* resolution: => fixed
Comment:
Implemented slightly differently in r3717.
--
Ticket URL: <http://trac.edgewall.org/ticket/3692#comment:5>
very nice, follow-up issue: #3704
--
Ticket URL: <http://trac.edgewall.org/ticket/3692#comment:6>
* type: enhancement => defect
* summary: [PATCH] - Enable Generic use of INavigationContributor =>
smart+question
Comment:
hello guys! http://hometown.aol.com/skylineblog/
--
Ticket URL: <http://trac.edgewall.org/ticket/3692#comment:7>