Wiki source code of All Tags

Last modified by Administrator on 2007/09/07 12:20

Show last authors
1 #if(!$request.tag)
2
3 #set($sql = "select distinct elements(prop.list) from BaseObject as obj, DBStringListProperty as prop where obj.className='XWiki.TagClass' and obj.id=prop.id.id and prop.id.name='tags'")
4 #set ($tags = $xwiki.search($sql))
5
6 #set ($title = "All Tags")
7 #if ($tags.size() > 0)
8 #set ($title = "$title <a href='$xwiki.getURL('Main.TagsRss', 'view', 'xpage=rdf')' style=''><img src='$xwiki.getSkinFile('icons/black-rss.png')'/></a>")
9 #end
10
11 1 $title
12
13 #if ($tags.size() == 0)
14 No documents have been tagged yet. To tag a document, edit it and enter the tags you wish to use in the Tag field visible on that page. For more information on tagging please refer to the [XWiki User Guide>http://www.xwiki.org/xwiki/bin/view/UserGuide/].
15 #else
16 The following tags are available on this wiki:
17 #foreach($tag in $tags)
18 * [$tag>$doc.fullName?tag=$tag] <a href="$xwiki.getURL("Main.TagsRss", "view", "tag=$tag&xpage=rdf")" style=""><img src="$xwiki.getSkinFile("icons/black-rss-mini.png")"></a>
19 #end
20 #end
21
22 #else
23 1 Documents tagged with '$request.tag' <a href="$xwiki.getURL("Main.TagsRss", "view", "tag=$request.tag&xpage=rdf")" style=""><img src="$xwiki.getSkinFile("icons/black-rss.png")" border="0px" /></a>
24
25 [View all tags>$doc.fullName]
26
27 #set($sql = ", BaseObject as obj, DBStringListProperty as prop where obj.name=doc.fullName and obj.className='XWiki.TagClass' and obj.id=prop.id.id and prop.id.name='tags' and '$request.tag' in elements(prop.list) order by doc.name asc")
28 #set ($list = $xwiki.searchDocuments($sql))
29 #includeInContext("XWiki.Results")
30 #end