ToDo

A Tagging System for Trac

The TagsPlugin implements both a generic tagging engine, and frontends for the Wiki and ticket systems. An extra text entry box is added to the Wiki edit page for tagging Wiki pages, and ticket fields (you can configure which ones) are treated as tags for the ticket system.

What are tags?

Tags are like hierarchically organized wiki entries, however with them you can categorize a wiki entry under multiple tags and not just under one hierarchy. You can then search for wiki entries categorized under a tag or a collection of tags. In other words, tags provide a ​faceted classification system for the Trac wiki.

As an added bonus, tags are linked to the wiki entry of the same name, allowing you to describe them explicitly under the wiki entry of the same name. This allows for a flexible means for establishing the context of wiki entries. Besides this, tags also make it incredibly easy to create todo lists or indexes.

Tags don't have to be predefined. As long as there are wiki entries categorized under a tag, it'll be automatically created.

Tags are similar to labels in gmail, tags in the social bookmark manager del.icio.us and Flickr. They are substantially different from Wikipedia categories, because tags are associated with wiki entries of the same name, whereas ​WikiMedia Categories are just indexes.

This implementation of wiki tagging is specific to Trac. To stay consistent with the way Trac names wiki entries, tags are case sensitive. Trac Hacks itself makes extensive use of tagging and is a good example of their use.

Usage

Apply tags

To create a tag, follow these steps:

Go to the wiki entry you want to tag.

Click on Edit This Page

Under Change information, Tag under:, enter the tags you want to categorize the entry under. Separate tags with spaces.

Click Save changes.

The wiki entry you edit is now categorized under the tags you specified.

Almost equivalent steps for tag entry at tickets, usually under keywords field.

Remove tags

To remove a tag from a wiki entry, follow these steps:

Go to the wiki entry you want to untag.

Click on Edit This Page

Under Change information, Tag under:, remove the tag from the list.

Click Save changes.

Almost equivalent steps for tag removing at tickets, usually under keywords field.

Searching tags

Querying is implemented through the /tags uri handler, the tag:<tag> syntax or ​Trac Macros as follows.

Tags query

Both the ListTagged macro and the /tags handler use a basic query language for filtering tagged objects. Query contains the terms to filter, can have some logical operators and have restrictions for where to search:

Space-separated terms logically ANDs them together.

Operators supported by the query language are:

Operator

Function

or

Logical or

not

Logical not

realm:<realm>

Restrict to tags in <realm> where realm is wiki, ticket, etc.

Sub-expressions can be grouped inside parentheses (, ).

Expressions and individual tags can be quoted with single ' or double " quotes. (check #3624)

Optional. Restrict tags search to a specific <realm> where <realm> is wiki or ticket (accepts only one realm).

realm:ticket

<query>

0.6

Displays a list of resources whose tags match <query>

None

format

0.7dev

Rendering Option.oldlist or short list in known ListTagged style; compact - list with results shortend to just the description; table - table view similar to TicketQuery with 'table' option

short

cols

0.7dev

Rendering Option. A pipe (|) separated list of columns to show when used format=table option. Available options are: * realm - identifies to which realm the resource is (wiki or ticket); * id - shows the name of the wiki page (if resource is a wiki) or ticket number (if resource is a ticket); * description - first title (if resource is a wiki) or ticket summary (if resource is a ticket); * tags - all applied tags for such resource

cols=id|description|tags

Examples

Intersection of macro and plugin tags: [[ListTagged(macro plugin)]]

All resources tagged macro but not plugin: [[ListTagged(macro -plugin)]]

Tickets tagged with macro: [[ListTagged(realm:ticket macro)]]

Pages tagged with macro: [[ListTagged(realm:wiki macro)]]

TagCloud macro

[[TagCloud(-Dummy)]]

Display a cloud of all tags, assuming you do not use the Dummy tag.

Install

Generic installation guidelines are troubleshooting can be found at TracPlugins.

Steps to install and configure this plugin are:

Install

Dependencies:

None:

Plugin:

Manually:

Download tags: [download:tagsplugin/tags/0.6 tags-0.6.zip] or grab
the source from SVN.

Preparing the plugin from source requires no additional steps for compiling message catalog files. Only to include translations marked as # fuzzy by the translator, you'll want to do a manual message catalog compilation with the extra -f argument before packaging:

Complaints about missing locale directory are often a side-effect of failure to compile any message catalog for inclusion into Python egg, hence the whole path is missing. Due to a know Trac issue Babel has to be installed prior to Trac, to get it all working as expected.
Again, for more details see the ​l10n cookbook page for Trac plugins.