Categorization and folksomony application

Function: RenderCategory

Render tools to handle categories

Documentation

This function is called in Category topics.

See the CategoryTemplate.

Parameters
NONE

Implementation

%STARTINCLUDE%
<noautolink>
%~~ MAKEINDEX{"
*~~
%~~     HIERARCHY{
~~~       web="%BASEWEB%"
~~~       top="%BASETOPIC%"
~~~       exclude="%BASETOPIC%"
~~~       depth="2"
~~~       format="$name;$web;$title;$summary;$leafs$n"
~~~     }%
*~~   "
~~~   cols="3"
~~~   header="<h2>Sub categories</h2>
~~~     There 
~~~     $percntIFDEFINED{\"$count\" as=\"1\" 
~~~       then=\" is one subcategory \"
~~~       else=\" are $count subcategories \"
~~~     }$percnt in this category."
~~~   split="\n"
~~~   pattern="(.*);(.*);(.*);(.*);(.*)"
~~~   format="[[$2.$1][$3]]
~~~     $percntIFDEFINED{\"$5\" then=\"&nbsp;($5)\"}$percnt
*~~     &nbsp;$percntREDDOT{$2.$1}$percnt
~~~     <div class='clsTopicInfo'>$4</div>
~~~  "
~~~ }%

%~~ MAKEINDEX{"
*~~
%~~    DBQUERY{
~~~      "!(TopicType=~'\bCategory\b') AND ('%BASETOPIC%' DISTANCE topic) = 0"
~~~      web="%BASEWEB%"
~~~      hidenull="on"
~~~      format="$topic;$web;$expand(Summary and ',<br />');$expand(info.author);$formatTime(info.date);$expand(TopicTitle or topic)"
~~~      separator="$n"
~~~    }%
*~~   "
~~~   cols="3"
~~~   header="<h2>Topics in $percntTOPICTITLE$percnt</h2>
~~~     There
~~~     $percntIFDEFINED{\"$count\" as=\"1\" 
~~~       then=\" is one topic \"
~~~       else=\" are $count topics \"
~~~     }$percnt in this category."
~~~   split="\n"
~~~   pattern="(.*);(.*);(.*);(.*);(.*);(.*)"
~~~   format="[[$2.$1][$6]]
*~~     &nbsp;$percntREDDOT{$2.$1}$percnt
~~~     <div class='clsTopicInfo'>$3 last modified $5 by $percntSPACEOUT{$4}$percnt</div>
~~~   "
~~~ }%

---
see also: [[CategoryBrowser][Browse Categories]], [[Category][Manage Categories]] 
%IFDEFINED{"%IFEXISTS{"%BASEWEB%.TopCategory"}%" as="1" else=" " then=", %CATINFO{cat="TopCategory"}%"}%
</noautolink>
%STOPINCLUDE%

Test

Calls to 'RenderCategory'

Copyright

© 2006-2007 Michael Daum http://wikiring.de

This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. For more details read the LICENSE.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Applications.ApplicationTopic
TopicType: DocuTopic, TopicFunction
TopicTitle:

Summary: Render tools to handle categories
TWikiApplication: ClassificationApp
r0 - 29 Dec 2007 - 17:03:59 - TWikiContributor
© giant orange extension cord that reeks hip-hop, funk & soul