[Moin-user] add links to header in Balanced theme?

George Oliver georgeolivergo at yahoo.com
Tue Jul 15 21:47:34 EDT 2008


Just wanted to post up my answer to this earlier question, as I hadn't found a short and clear answer in the archives when I checked. Of course the answer is a fairly easy one :). 

In balanced.py there are two functions, header() and footer(), each returning a list called html (among other items). The list html is composed of a number of functions which display things like the search form, editing links, and so forth, and to add a new link you just need to choose which function you want to add to. 

I chose the function username(); that function returns a list called userlinks, and to add a link all you do is

userlinks.append(u'<a href="<your link goes here>">Your link name</a>') 

Do this just before the list comprehension at the end of the username() defintion (or wherever is appropriate if you choose a different function). 

Your link probably will be relative, like "/<relative link". 

As to the problem of refreshing, I'm not totally clear on the issues but what I needed to do was delete the compiled balanced.pyc and restart the Apache server after a change. This seems to clear up the problem, by I'm guessing generating a new .pyc from the edited balanced.py.  


      




More information about the Moin-user mailing list