Edgewall Software

Changes between Version 84 and Version 85 of TracInterfaceCustomization


Ignore:
Timestamp:
May 13, 2015, 7:18:20 PM (9 years ago)
Author:
Jun Omae
Comment:

Added syntax highlighting

Legend:

Unmodified
Added
Removed
Modified
  • TracInterfaceCustomization

    v84 v85  
    5959Trac 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`:
    6060
    61 {{{
    62 #!xml
     61{{{#!xml
    6362<html xmlns="http://www.w3.org/1999/xhtml"
    6463      xmlns:py="http://genshi.edgewall.org/"
     
    111110
    112111If 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
    115113<form py:match="div[@id='content' and @class='ticket']/form" py:attrs="select('@*')"
    116114        xmlns:xi="http://www.w3.org/2001/XInclude">
     
    130128The 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:
    131129
    132 {{{
    133 #!text/html
     130{{{#!text/html
    134131<!DOCTYPE html
    135132    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     
    159156
    160157For [wiki:TracModWSGI mod_wsgi]:
    161 {{{
     158{{{#!python
    162159os.environ['TRAC_ENV_INDEX_TEMPLATE'] = '/path/to/template.html'
    163160}}}
    164161
    165162For [wiki:TracFastCgi FastCGI]:
    166 {{{
     163{{{#!apache
    167164FastCgiConfig -initial-env TRAC_ENV_PARENT_DIR=/parent/dir/of/projects \
    168165              -initial-env TRAC_ENV_INDEX_TEMPLATE=/path/to/template
     
    170167
    171168For [wiki:TracModPython mod_python]:
    172 {{{
     169{{{#!apache
    173170PythonOption TracEnvParentDir /parent/dir/of/projects
    174171PythonOption TracEnvIndexTemplate /path/to/template
     
    176173
    177174For [wiki:TracCgi CGI]:
    178 {{{
     175{{{#!apache
    179176SetEnv TRAC_ENV_INDEX_TEMPLATE /path/to/template
    180177}}}
     
    182179For [wiki:TracStandalone], you'll need to set up the `TRAC_ENV_INDEX_TEMPLATE` environment variable in the shell used to launch tracd:
    183180 - Unix
    184    {{{
    185 #!sh
     181   {{{#!sh
    186182$ export TRAC_ENV_INDEX_TEMPLATE=/path/to/template
    187183   }}}
    188184 - Windows
    189    {{{
    190 #!sh
     185   {{{#!sh
    191186$ set TRAC_ENV_INDEX_TEMPLATE=/path/to/template
    192187   }}}