7 | | With this patch you can specify a `[project_info]` stanza in your `trac.ini` file, and everything in that stanza will be passed to your project listing template as key-value pairs under the dictionary `project.info`. |
| 7 | With this patch you can specify key-value pairs that will be passed on to your project listing template. To achieve this, it requires a new `[project_info]` stanza in your `trac.ini` file that acts as a dictionary of the key-value pairs. |
| 8 | |
| 9 | Imagine you have trac.ini's for each project with data like: |
| 10 | {{{#!ini |
| 11 | [project_info] |
| 12 | short_name = my_project |
| 13 | status = active |
| 14 | order = 3 |
| 15 | }}} |
| 16 | |
| 17 | You can then iterate over them in your project listing template like: |
| 18 | {{{ |
| 19 | <div class='incubator'> |
| 20 | <h3>Incubator</h3> |
| 21 | <div py:for='project in projects' py:if='project.info.get("status") == "incubator"' class='project'> |
| 22 | <a class='name' href='${project.href}'>${project.name}</a> - |
| 23 | <span class='description'>${project.description}</span> |
| 24 | </div> |
| 25 | </div> |
| 26 | }}} |
31 | | Imagine you have trac.ini's for each project with data like: |
32 | | {{{#!ini |
33 | | [project_info] |
34 | | short_name = my_project |
35 | | status = active |
36 | | order = 3 |
37 | | }}} |
38 | | |
39 | | You can then iterate over them in your project listing template like: |
40 | | {{{ |
41 | | <div class='incubator'> |
42 | | <h3>Incubator</h3> |
43 | | <div py:for='project in projects' py:if='project.info.get("status") == "incubator"' class='project'> |
44 | | <a class='name' href='${project.href}'>${project.name}</a> - |
45 | | <span class='description'>${project.description}</span> |
46 | | </div> |
47 | | </div> |
48 | | }}} |
| 50 | General instructions on installing Trac plugins can be found on the [TracPlugins#InstallingaTracplugin TracPlugins] page. |