[Moin-user] Tabbed action theme

Jim Clark jimbobclark at ukonline.co.uk
Wed Jun 23 16:15:09 EDT 2004


I'm looking into making a theme with actions as CSS style tabs, similar 
to the format used with wikipedia now.  I'm not a CSS expert, so I 
looked around for inspiration and found this:


This uses a class attribute of the <body> tag to determine the currently 
active tab (action) and sets up the formatting accordingly.

I managed most things by making a new theme.py and .css file (which I'll 
add to the moinmoin wiki if they work correctly), however I found myself 
doing some extra hacking within the main code to get the results I was 
looking for.  My change was in wikiutil.py where I added the code:

     if  request.form.has_key('action'):
         bodyattr += ' class=' + request.form['action'][0]
         bodyattr += ' class=view'

before the emission of the <body> tag.  With this in place, the CSS tab 
selection seemed to all be working.

Now this is ugly and I'm wondering if there's a correct way I could 
manage the same effects - any thoughts?


More information about the Moin-user mailing list