Changes between Version 37 and Version 38 of TracInterfaceCustomization
- Timestamp:
- Jan 16, 2007, 1:37:44 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracInterfaceCustomization
v37 v38 40 40 }}} 41 41 42 == Site Header & Footer == 43 42 == Site Appearance == 43 44 === Trac 0.10 and below === 45 46 ==== Site Header & Footer ==== 44 47 In 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. 45 48 … … 56 59 }}} 57 60 58 59 == Site CSS == 61 ==== Site CSS ==== 60 62 The 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. 61 63 … … 70 72 {{{ 71 73 @import url(<?cs var:chrome.href ?>/site/style.css); 74 }}} 75 76 === Trac 0.11 and above === 77 78 Since release [milestone:0.11], Trac is using [http://genshi.edgewall.org Genshi] as the templating engine.[[BR]] 79 Therefore, customization of the interface is achieved in a slightly different way than it used to be with the ClearSilver templating engine. 80 81 Documentation is yet to be written, in the meantime the following tip should work. 82 83 Say you want to add a link to a custom stylesheet, and then your own 84 header 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> 72 113 }}} 73 114