[Moin-user] Changing navibar behavior

Christopher MacMinn cmac at mit.edu
Wed Feb 11 13:55:06 EST 2009

> >>> I'm using MoinMoin to run a non-wiki website, and I would like to
> >>> customize the behavior of the navibar.  In particular, I would like for
> >>> the current page NOT to be added to the navibar if it is not already
>>> in the navibar.  I am comfortable (ish) with python, html, css, etc.,
>>> but I'm not sure which file to modify.  Can someone point me in the
> right direction?
> >>
> >> You could try replacing the navibar with the sidebar taken from Mandarin
> >> or Gugiel themes -- I find them much more flexible and useful for static
> >> non-wiki sites, plus you can edit them from the wiki itself.
> I grabbed the sidebar function definition from gugiel.py, but I don't
> > understand where the sidebar comes from -- do I need to create my own
> > HTML file named sidebar.html and stick it somewhere?
> the sidebar itself is another wiki page. so you can add to your current
> page a pragma command like "#pragma sidebar MySideBar and then create a
> new page named MySideBar. This wiki page "MySideBar" will be now
> included in your page (with the pragma). sometimes you can also define a
> default sidebar. just create a page called "SideBar" and this page will
> be displayed/included on every single wiki page.

Ah, I see -- thanks!  I may do this sometime down the road...

As it turns out, I stumbled upon a much simpler method for now:  navibar
items specified in wikiconfig.py are created as <li> elements with class
"wikilink" -- if the current page is one of these, it also gets the class
"current"; if not, a new <li> item is added with the class "current" but NOT
the class "wikilink".  Because of this, the following CSS rules do a fine
job of keeping the unwanted items out of the navibar:

ul#navibar li { display: none; }
ul#navibar li.wikilink { display: inline; }

Thanks for your help!

Best, Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/moin-user/attachments/20090211/cd1d1be7/attachment.html>

More information about the Moin-user mailing list