| 1 | = Patch Trac to allow Arbitrary Project Properties = |
| 2 | |
| 3 | == Description == |
| 4 | |
| 5 | Using 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``. |
| 6 | |
| 7 | You can do this inside your project listings too, with the ArbitraryOptionsPlugin. |
| 8 | |
| 9 | == Bugs/Feature Requests == |
| 10 | |
| 11 | Existing bugs and feature requests for ArbitraryProjectPropertiesPatch are |
| 12 | [report:9?COMPONENT=ArbitraryProjectPropertiesPatch here]. |
| 13 | |
| 14 | If you have any issues, create a |
| 15 | [http://trac-hacks.org/newticket?component=ArbitraryProjectPropertiesPatch&owner=david new ticket]. |
| 16 | |
| 17 | == Download == |
| 18 | |
| 19 | Download the zipped source from [download:arbitraryprojectpropertiespatch here]. |
| 20 | |
| 21 | == Source == |
| 22 | |
| 23 | You can check out ArbitraryProjectPropertiesPatch from [http://trac-hacks.org/svn/arbitraryprojectpropertiespatch here] using Subversion, or [source:arbitraryprojectpropertiespatch browse the source] with Trac. |
| 24 | |
| 25 | == Example == |
| 26 | |
| 27 | Imagine you have trac.ini's for each project with data like: |
| 28 | {{{ |
| 29 | [project_info] |
| 30 | short_name = my_project |
| 31 | status = active |
| 32 | order = 3 |
| 33 | }}} |
| 34 | |
| 35 | |
| 36 | You can then iterate over them in your project listing template like: |
| 37 | {{{ |
| 38 | <div class='incubator'> |
| 39 | <h3>Incubator</h3> |
| 40 | <div py:for='project in projects' py:if='project.info.get("status") == "incubator"' class='project'> |
| 41 | <a class='name' href='${project.href}'>${project.name}</a> - |
| 42 | <span class='description'>${project.description}</span> |
| 43 | </div> |
| 44 | </div> |
| 45 | }}} |
| 46 | |
| 47 | == Recent Changes == |
| 48 | |
| 49 | [[ChangeLog(arbitraryprojectpropertiespatch, 3)]] |
| 50 | |
| 51 | == Author/Contributors == |
| 52 | |
| 53 | '''Author:''' [wiki:david] [[BR]] |
| 54 | '''Maintainer:''' [wiki:david] [[BR]] |
| 55 | '''Contributors:''' |