Edgewall Software

Changes between Version 27 and Version 28 of TracDev/ApiChanges/0.11


Ignore:
Timestamp:
Dec 7, 2007, 3:29:07 PM (16 years ago)
Author:
Christian Boos
Comment:

document #ITemplateStreamFilter

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/ApiChanges/0.11

    v27 v28  
    156156==== `trac.web.ITemplateStreamFilter` ==== #ITemplateStreamFilter
    157157
    158 TBD.
     158In 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.
     159Among 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
     161Some 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
    159165
    160166==== `trac.prefs.api.IPreferencePanelProvider` ==== #IPreferencePanelProvider