| 59 | |
| 60 | == Project List == |
| 61 | You can use a custom ClearSilver template to display the list of projects when you are using Trac with multiple projects. |
| 62 | |
| 63 | This 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 | |
| 87 | Once you've created your custom template you will need to configure the webserver to tell Trac where the template is located: |
| 88 | |
| 89 | For [wiki:TracFastCgi FastCGI]: |
| 90 | {{{ |
| 91 | FastCgiConfig -initial-env TRAC_ENV_PARENT_DIR=/parent/dir/of/projects \ |
| 92 | -initial-env TRAC_ENV_INDEX_TEMPLATE=/path/to/template |
| 93 | }}} |
| 94 | |
| 95 | For [wiki:TracModPython mod_python]: |
| 96 | {{{ |
| 97 | PythonOption TracEnvIndexTemplate /path/to/template |
| 98 | }}} |
| 99 | |
| 100 | For [wiki:TracCgi CGI]: |
| 101 | {{{ |
| 102 | SetEnv TRAC_ENV_INDEX_TEMPLATE /path/to/template |
| 103 | }}} |
| 104 | |
| 105 | |