Edgewall Software

Changes between Version 18 and Version 19 of TracInterfaceCustomization


Ignore:
Timestamp:
Dec 4, 2005, 7:57:22 PM (18 years ago)
Author:
Matthew Good
Comment:

add info on custom project index

Legend:

Unmodified
Added
Removed
Modified
  • TracInterfaceCustomization

    v18 v19  
    11= Customizing the Trac Interface =
    2 [[TracGuideToc]]
     2[[PageOutline(2-3,Contents)]]
    33
    44== Introduction ==
     
    5757@import url(<?cs var:chrome.href ?>/site/style.css);
    5858}}}
     59
     60== Project List ==
     61You can use a custom ClearSilver template to display the list of projects when you are using Trac with multiple projects. 
     62
     63This 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.
     64
     65{{{
     66#!text/html
     67<html>
     68<head><title>Available Projects</title></head>
     69<body>
     70 <h1>Available Projects</h1>
     71 <ul><?cs
     72 each:project = projects ?><li><?cs
     73  if:project.href ?>
     74   <a href="<?cs var:project.href ?>" title="<?cs var:project.description ?>">
     75    <?cs var:project.name ?></a><?cs
     76  else ?>
     77   <small><?cs var:project.name ?>: <em>Error</em> <br />
     78   (<?cs var:project.description ?>)</small><?cs
     79  /if ?>
     80  </li><?cs
     81 /each ?>
     82 </ul>
     83</body>
     84</html>
     85}}}
     86
     87Once you've created your custom template you will need to configure the webserver to tell Trac where the template is located:
     88
     89For [wiki:TracFastCgi FastCGI]:
     90{{{
     91FastCgiConfig -initial-env TRAC_ENV_PARENT_DIR=/parent/dir/of/projects \
     92              -initial-env TRAC_ENV_INDEX_TEMPLATE=/path/to/template
     93}}}
     94
     95For [wiki:TracModPython mod_python]:
     96{{{
     97PythonOption TracEnvIndexTemplate /path/to/template
     98}}}
     99
     100For [wiki:TracCgi CGI]:
     101{{{
     102SetEnv TRAC_ENV_INDEX_TEMPLATE /path/to/template
     103}}}
     104
     105
    59106
    60107== Main Templates ==