Version 27 (modified by hauma, 14 years ago) (diff)

Answer for "always expand".

TracNav: The navigation bar for Trac

The [[TracNav]] macro implements a fully customizable navigation bar for the Trac wiki engine. The contents of the navigation bar is a wiki page itself and can be edited like any other wiki page through the web interface. The navigation bar supports hierarchical ordering of topics. The design of TracNav mimics the design of the TracGuideToc that was originally supplied with Trac. The drawback of TracGuideToc is that it is not customizable without editing its source code and that it does not support hierarchical ordering.

A life example of TracNav can be seen on the right. Please use this navigation bar to learn more about TracNav.

If you just want to play around with TracNav, please use the SandBox!

Comment by cboos@… on Wed Mar 2 19:28:09 2005

Excellent idea''
-- CB

Comment by reinhard.brandstaedter at on Thu Jul 14 10:44:50 2005

Great stuff! But I'm wondering how to use multiple hierarchies in the navigation with links enabled. In your Nav: "See also" as heading "TracNav" as subheading with link-function "Overview" as subsubheading with link function

Is this possible? Everytime I add a child-link tocentry under a link this link is not displayed.


Comment by pellatt@… on Sat Jul 16 11:56:43 2005

I'd like to use this for making a few quick links to things like current milestones and reports, any chance of adding that functionality?


available since r3057, and also in Release 3.2 to the MacroBazaar
-- Thomas

Comment by christophe on Thu Aug 4 18:09:10 2005

ceci est un test, merci pour votre travail ;)

Comment by sewerson on Fri Aug 19 21:32:45 2005

TracNav always responds with Error: Macro TracNav(TOC) failed not all arguments converted during string formatting somehow buggy code

TracNav works with Trac >= version 0.9 since r3044 resp. Release 3 to the MacroBazaar
-- Thomas

Comment by anonymous on Mon Nov 21 19:56:18 2005

How about support for inline navigation?

Comment by jose@… on Thu Feb 9 09:05:07 2006

OK I give how do I download this? I click on the links and they show the code embedded in a webpage but no way to actually download the code

Comment by jose@cybergalvez on Thu Feb 9 09:15:22 2006

Sorry about the previous comment I figured it out

Comment by anonymous on Sun Feb 19 22:46:31 2006

I'd like to force TracNav to show the entire TOC in all cases, without collapsing or formatting some captions bold+black. Is there any way to do this?

You may try to remove the call to the filter_toc function. In line 218, replace

(found, filtered) = filter_toc(curpage, toc, 0)


(found, filtered) = (0, toc)

This will display the TOC alway fully expanded like in the TOC edit mode. If you now really do not like bold face for headings, you can experiment with the line 82 in wiki.css:

Try to add to

.wiki-toc.trac-nav h4 { margin: 0; padding: 0; }

the style you like for headings, e.g.

.wiki-toc.trac-nav h4 { margin: 0; padding: 0; font-weight: normal; }

I did not try this recipe myself, you might have to experiment a little. Regards, Haui