Question

We use hosted Trac. It uses Genshi templates. I think we can submit our own site.html. We want to get rid of Trac standard footer. What is the most elegant way of doing that?

I suspect that the answer is in some nice Genshi trick. I don't know Genshi nor Trac's additions to it. I tried couple of things on a hunch, none worked.

I tried css

 <style type="text/css">
     #footer 
     {
         visibility:hidden;
     }
 </style>

That is ok, unless you want to use your own footer (called "#sitefooter"). This one comes after "#footer", and hiding footer leaves an ugly white space.

Then I tried jquery:

<script>
 jQuery(document).ready(function($) { $("#footer").text(''); });
</script>

This is fine yet I am not sure how wide support for jquery really is.

Was it helpful?

Solution

I don't have a recent copy of trac on me at present to poke into as far as templates go, but for CSS, you want to try

display: none;
margin: 0;
padding: 0;

instead of

visibility:hidden;

visibility hidden items still take up space.

OTHER TIPS

The most elegant way is to just change it in trac.ini. The footer is set in in trac.ini, and this is the default:

[project]
footer = Visit the Trac open source project at<br /><a href="http://trac.edgewall.org/">http://trac.edgewall.org/</a>

Most elegant way is to modify site.html under

/path-to-trac/projectname/templates/

Example site.html file:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/" py:strip="">
<!--! Custom match templates go here -->
<div py:match="div[@id='footer']">
    <!-- put custom footer markup here -->
</div>
</html>

Credit to marcin.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top