]> sipb.mit.edu Git - ikiwiki.git/blob - underlays/basewiki/directive/tag.mdwn
move back demo and add example
[ikiwiki.git] / underlays / basewiki / directive / tag.mdwn
1 The `tag` and `taglink` directives are supplied by the [[!iki plugins/tag]] plugin.
2
3 These directives allows tagging pages. List tags as follows:
4
5         \[[!tag tech life linux]]
6
7 The tags work the same as if you had put a (hidden) [[ikiwiki/WikiLink]] on
8 the page for each tag, so you can use a [[ikiwiki/PageSpec]] match all
9 pages that are tagged with a given tag, for example. The tags will also
10 show up on blog entries and at the bottom of the tagged pages, as well as
11 in RSS and Atom feeds.
12
13 If you want a visible [[ikiwiki/WikiLink]] along with the tag, use taglink
14 instead:
15
16         \[[!taglink foo]]
17         \[[!taglink tagged_as_foo|foo]]
18
19 This plugin has a configuration option. Set --tagbase=tags and links to tags
20 will be located under the specified base page. If ikiwiki is configured
21 this way, then the example above actually tags the page with the tags
22 tags/tech, tags/life, and tags/linux. This is a useful way to avoid
23 having to write the full path to tags, if you want to keep them grouped
24 together out of the way.
25
26 If you want to override the tagbase for a particular tag, you can use
27 something like this:
28
29         \[[!tag ./foo]]
30         \[[!taglink /foo]]
31
32 [[!if test="enabled(tag)" then="""
33 This wiki has the tag plugin enabled, so you'll see a note below that this
34 page is tagged with the "tags" tag.
35 """]]