15 | | Note that this is only implemented for Genshi at present, but you could add a line or two for !ClearSilver, although this is untested. |
| 15 | For example, if your `trac.ini` file had this: |
| 16 | |
| 17 | {{{#!ini |
| 18 | [project_info] |
| 19 | short_name = my_project |
| 20 | status = active |
| 21 | order = 3 |
| 22 | }}} |
| 23 | |
| 24 | You could access it in your Trac's Genshi templates like this: |
| 25 | |
| 26 | {{{ |
| 27 | Short name is ${project_info.get('short_name')}. Status is ${project_info.get('status')}. Order is ${project_info.get('order')}. |
| 28 | }}} |
| 29 | |
| 30 | You could iterate over your whole projects list like this: |
| 31 | {{{ |
| 32 | <li py:for='proj in projects' py:if='proj.name != project.name and proj.info.get("status") == "primary"> |
| 33 | <a href='/${proj.href}'>${proj.name}</a>; |
| 34 | </li> |
| 35 | }}} |
| 36 | |
| 37 | Note that this is only implemented for the Genshi templating engine at present. |
44 | | == Example |
45 | | |
46 | | If your `trac.ini` file had this: |
47 | | |
48 | | {{{#!ini |
49 | | [project_info] |
50 | | short_name = my_project |
51 | | status = active |
52 | | order = 3 |
53 | | }}} |
54 | | |
55 | | You could access it in your Trac's Genshi templates like this: |
56 | | |
57 | | {{{ |
58 | | Short name is ${project_info.get('short_name')}. Status is ${project_info.get('status')}. Order is ${project_info.get('order')}. |
59 | | }}} |
60 | | |
61 | | You could iterate over your whole projects list like this: |
62 | | {{{ |
63 | | <li py:for='proj in projects' py:if='proj.name != project.name and proj.info.get("status") == "primary"> |
64 | | <a href='/${proj.href}'>${proj.name}</a>; |
65 | | </li> |
66 | | }}} |
67 | | |
68 | | See also http://www.siafoo.net/snippet/276 for more information. |
69 | | |
70 | | See http://projects.icapsid.net/adjector for a usage example. |
71 | | |