Edgewall Software

Changes between Version 37 and Version 38 of TracInterfaceCustomization


Ignore:
Timestamp:
Jan 16, 2007, 1:37:44 AM (17 years ago)
Author:
Emmanuel Blot
Comment:

Add a temporary note about customization w/ Trac 0.11

Legend:

Unmodified
Added
Removed
Modified
  • TracInterfaceCustomization

    v37 v38  
    4040}}}
    4141
    42 == Site Header & Footer ==
    43 
     42== Site Appearance ==
     43
     44=== Trac 0.10 and below ===
     45
     46==== Site Header & Footer ====
    4447In the environment folder for each Trac project there should be a directory called {{{templates}}}.  This folder contains files {{{site_header.cs}}} and {{{site_footer.cs}}}.  Users can customize their Trac site by adding the required HTML markup to these files.  The content of these two files will be placed immediately following the opening {{{<body>}}} tag and immediately preceding the closing {{{</body>}}} tag of each page in the site, respectively.
    4548
     
    5659}}}
    5760
    58 
    59 == Site CSS ==
     61==== Site CSS ====
    6062The primary means to adjust the layout of a Trac site is to add [http://www.w3.org/TR/REC-CSS2/ CSS] style rules that overlay the default rules. This is best done by editing the `site_css.cs` file in the enviroment's `templates` directory. The content of that template gets inserted into a `<style type="text/css"></style>` element on every HTML page generated by Trac.
    6163
     
    7072{{{
    7173@import url(<?cs var:chrome.href ?>/site/style.css);
     74}}}
     75
     76=== Trac 0.11 and above ===
     77
     78Since release [milestone:0.11], Trac is using [http://genshi.edgewall.org Genshi] as the templating engine.[[BR]]
     79Therefore, customization of the interface is achieved in a slightly different way than it used to be with the ClearSilver templating engine.
     80
     81Documentation is yet to be written, in the meantime the following tip should work.
     82
     83Say you want to add a link to a custom stylesheet, and then your own
     84header and footer:
     85
     86{{{
     87#!xml
     88<html xmlns="http://www.w3.org/1999/xhtml"
     89      xmlns:py="http://genshi.edgewall.org/"
     90      py:strip="">
     91
     92  <!--! Add site-specific style sheet -->
     93  <head py:match="head" py:attrs="select('@*')">
     94    ${select('*')}
     95    <link rel="stylesheet" type="text/css"
     96          href="${href.chrome('site/style.css')}" />
     97  </head>
     98
     99  <body py:match="body" py:attrs="select('@*')">
     100    <!--! Add site-specific header -->
     101    <div id="siteheader">
     102      ...
     103    </div>
     104
     105    ${select('*|text()')}
     106
     107    <!--! Add site-specific footer -->
     108    <div id="sitefooter">
     109      ...
     110    </div>
     111  </body>
     112</html>
    72113}}}
    73114