Opened 17 years ago
Closed 17 years ago
#2624 closed enhancement (fixed)
Option to have the link in ctxtnav instead of mainnav
Reported by: | izzy | Owned by: | Radek Bartoň |
---|---|---|---|
Priority: | normal | Component: | ScreenshotsPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.10 |
Description
Since the main navigation bar fills up too much, I'ld prefer to have the item added to the ctxtnav of the wiki instead. Is that possible?
What I tried already: I disabled the items entry in the main navigation bar successfully using the NavHiderPlugin. Then I wanted to add the link conditionally to the ctxtnav in wiki.cs - but I could not figure out how to check whether the ScreenshotsPlugin is enabled (makes no sense to have the link there otherwise). So providing the correct "if:" statement would already solve my problem ;) Searched with Google for hours without finding a result, looking for something like "if:plugin.<name>.enabled"...
Attachments (0)
Change History (4)
comment:1 Changed 17 years ago by
comment:2 Changed 17 years ago by
Status: | new → assigned |
---|
ctxtnav (Context Navigation Bar) is ment for links related to current context (Wiki pages in this case) so there is no direct way how to append an item to this bar within different plugin. Although it can be done with certain hacks I'm not willing to incorporate this in plugin since it breaks the logical organization of Trac's navigation.
I can change behavior of plugin the way that if there is an empty string value of title
configuration option main navigation button is hidden and append metanav_title
option to show link to screenshots in meta navigation bar (above mainnav).
Would you like these changes?
comment:3 Changed 17 years ago by
Though IMHO the metanav is not the most suitable place (as far as I could see, it mostly holds account - login, logout, my account, settings - and trac specific links), it would at least provide an alternative to an overfilled main navigation. As for me, the work-around posted above works fine. So you may go along mention that in the short docu as well. If you'ld provide the possibility to have neither the main nav nor the metanav link used (e.g. by leaving both settings empty), people could decide to add it to their ctxnav like mentioned above.
comment:4 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Done in r3271. Now there are mainnav_title
and metanav_title
config opitons. Each disable item if they are empty (metanav by default). Maybe I'll try to use IRequestFilter::pre_process_request() and match Wiki page requests to add context navigation items from this context if it is possible which would append wiki_title
option with similar meaning.
Just found some solution for this:
Just a little change to wiki.cs - if you may want to add this hint to your FAQ/plugin article, feel free. Works for me so far - but of course it would be better to have the option somewhere, to not depend on another plugin ;) The other change (to remove the original item from the main navigation bar) was installing and activating NavHiderPlugin plus adding
!screenshots
to themainnav
setting in trac.ini