tags:

views:

357

answers:

2

Hi,

I have some trouble with my trac installation (version 11.4). What should I do to change i.e. some colors in the default theme? I've found various tips in the net, but nothing worked yet as most tips were for the 10.x version.

Are there any options in trac.ini or should I add a special xyz.css somewhere in my environment?

Please help me, I don't like the default black & white design ;)

A: 

Instructions for how to do this for version 0.11 can be found at the Trac site, here's an example from that page that adds custom CSS as well as a header and a footer.

Say you want to add a link to a custom stylesheet, and then your own header and footer. Create a file /path/to/env/templates/site.html or /path/to/inherit/option/templates_dir/site.html, with contents like this:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      py:strip="">

  <!--! Add site-specific style sheet -->
  <head py:match="head" py:attrs="select('@*')">
    ${select('*')}
    <link rel="stylesheet" type="text/css"
          href="${href.chrome('site/style.css')}" />
  </head>

  <body py:match="body" py:attrs="select('@*')">
    <!--! Add site-specific header -->
    <div id="siteheader">
      <!--! Place your header content here... -->
    </div>

    ${select('*|text()')}

    <!--! Add site-specific footer -->
    <div id="sitefooter">
      <!--! Place your footer content here... -->
    </div>
  </body>
</html>
Adam Bellaire
But this changes the whole template. Do I have to copy the default template into my templates directory and add my custom css code?
Zappi
@Zappi: That's what we've done. I don't know of any other way to go about it. The way Genshi works I think you have modify the main template to get your custom CSS included. But I am by no means an expert with Genshi. :)
Adam Bellaire
Adams answer was right, thank you.I thought this would replace the template, but all the select(...) stuff refers to tracs default template. Genshi allows some sort of 'inheritance'. You can select parts of the parents file and import them to your own template.See http://genshi.edgewall.org/wiki/GenshiTutorial#AddingaLayoutTemplateSo this code imports everything from <head> and <body> and adds <link> and two <div> to the page.
Zappi
A: 

Another option is to install a Trac Theme.

RjOllos