Setting up tags in Trac

Note: setuptools must be installed on your system for this to work.

  1. Install Trac 0.9 or 0.10dev and set up a trac project.
  2. Build your own egg from the source ZIP or Subversion repository.
  3. Update your trac.ini with the following:
    [trac]
    default_handler = TagsWikiModule
    
    [components]
    trac.wiki.web_ui.wikimodule = disabled
    tractags.* = enabled
    

Be carefull with the default_handler entry, it's already in the file. You must override it!

  1. Run trac-admin <env> upgrade on your Trac environment.
  2. Restart your web server.

At this stage the plugin should be working and you should see a text control for tags in your Wiki edit page. You should also see a navigation link in the top-right corner labelled Tag Index.


You're good to go. See TagsPlugin for more on how to use tags.

Customising the Default Behaviour

If you want to customize the default behaviour of the tag index, or any of the macros, edit the [tags] section of your trac.ini:

OptionDescription
index=cloud|listDisplay the tag index as a cloud or list?
index.args=...Keyword arguments to pass to the index display function (see TagCloud and ListTags for details).
listing.args=...Keyword arguments to pass to the listing for each tag under the /tags/ URL space.
<macro>.args=...Default arguments to pass to each of the tag macros, in addition to those provided in the macro call.
expression_space=...true or false. enables/disables expression support under /tags

eg.

[tags]
index = cloud
index.args = smallest=10, biggest=40, mincount=2, showcount=false
listing.args = showheadings=true
tagcloud.args = mincount=2, showcount=false

If you want to customize which ticket fields to extract tags from, edit the fields variable in [tags.ticket] section in trac.ini. (Fields that can be used: component,severity,keywords,priority,owner,reporter,cc,version,milestone,status,resolution,summary,description; summary and description aren't recommended.). e.g.

[tags.ticket]
fields=component,severity,keywords