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 tag from BaseObject as obj, DBStringListProperty as prop join prop.list as tag where obj.className='XWiki.TagClass' and obj.id=prop.id.id and prop.id.name='tags' order by 1 asc")
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($tagFilter = '')
28 #foreach($requestedTag in $request.getParameterValues('tag'))
29 #set($tagFilter = "${tagFilter} and '${requestedTag}' in elements(prop.list)")
30 #end
31 #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' ${tagFilter} order by doc.name asc")
32 #set ($list = $xwiki.searchDocuments($sql))
33 #includeInContext('XWiki.Results')
34 #end