158 | | TBD. |
| 158 | In Trac 0.11, while it's still possible to customize the Genshi templates like it was for the Clearsilver ones in previous versions, this is no longer the only way, neither the preferred. What makes the use of the Genshi templating system fairly unique is that you can manipulate the generated output at run-time, in order to filter out some content, modify it or even inject new content. |
| 159 | Among other things, leaving the original templates alone make it much easier to benefit from bug fixes and improvements made in newer mainstream Trac versions. All you need for that is to write a plugin implementing the ITemplateSreamFilter interface, which allows you to have complete control on the generated Genshi event stream. |
| 160 | |
| 161 | Some useful references: |
| 162 | - [http://trac.edgewall.org/browser/trunk/sample-plugins/ticket_clone.py sample-plugins/ticket_clone.py], an example of such a plugin, which adds a "Clone" button in the ticket description box: |
| 163 | - [genshi:wiki:ApiDocs/genshi.filters.transform genshi.filters.transform], the API documentation for genshi transform filters which makes such manipulations a breeze |
| 164 | |