Changes between Version 84 and Version 85 of TracInterfaceCustomization
- Timestamp:
- May 13, 2015, 7:18:20 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracInterfaceCustomization
v84 v85 59 59 Trac is using [http://genshi.edgewall.org Genshi] as the templating engine. Say you want to add a link to a custom stylesheet, and then your own header and footer. Save the following content as `site.html` inside your projects `templates/` directory (each Trac project can have their own `site.html`), eg `/path/to/env/templates/site.html`: 60 60 61 {{{ 62 #!xml 61 {{{#!xml 63 62 <html xmlns="http://www.w3.org/1999/xhtml" 64 63 xmlns:py="http://genshi.edgewall.org/" … … 111 110 112 111 If the environment is upgraded from 0.10 and a `site_newticket.cs` file already exists, it can be loaded using a workaround - providing it contains no [trac:ClearSilver] processing. In addition, as only one element can be imported, the content needs some sort of wrapper such as a `<div>` block or other similar parent container. The XInclude namespace must be specified to allow includes, but that can be moved to document root along with the others: 113 {{{ 114 #!xml 112 {{{#!xml 115 113 <form py:match="div[@id='content' and @class='ticket']/form" py:attrs="select('@*')" 116 114 xmlns:xi="http://www.w3.org/2001/XInclude"> … … 130 128 The following is the basic template used by Trac to display a list of links to the projects. For projects that could not be loaded, it displays an error message. You can use this as a starting point for your own index template: 131 129 132 {{{ 133 #!text/html 130 {{{#!text/html 134 131 <!DOCTYPE html 135 132 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" … … 159 156 160 157 For [wiki:TracModWSGI mod_wsgi]: 161 {{{ 158 {{{#!python 162 159 os.environ['TRAC_ENV_INDEX_TEMPLATE'] = '/path/to/template.html' 163 160 }}} 164 161 165 162 For [wiki:TracFastCgi FastCGI]: 166 {{{ 163 {{{#!apache 167 164 FastCgiConfig -initial-env TRAC_ENV_PARENT_DIR=/parent/dir/of/projects \ 168 165 -initial-env TRAC_ENV_INDEX_TEMPLATE=/path/to/template … … 170 167 171 168 For [wiki:TracModPython mod_python]: 172 {{{ 169 {{{#!apache 173 170 PythonOption TracEnvParentDir /parent/dir/of/projects 174 171 PythonOption TracEnvIndexTemplate /path/to/template … … 176 173 177 174 For [wiki:TracCgi CGI]: 178 {{{ 175 {{{#!apache 179 176 SetEnv TRAC_ENV_INDEX_TEMPLATE /path/to/template 180 177 }}} … … 182 179 For [wiki:TracStandalone], you'll need to set up the `TRAC_ENV_INDEX_TEMPLATE` environment variable in the shell used to launch tracd: 183 180 - Unix 184 {{{ 185 #!sh 181 {{{#!sh 186 182 $ export TRAC_ENV_INDEX_TEMPLATE=/path/to/template 187 183 }}} 188 184 - Windows 189 {{{ 190 #!sh 185 {{{#!sh 191 186 $ set TRAC_ENV_INDEX_TEMPLATE=/path/to/template 192 187 }}}