%META:TOPICINFO{author="TWikiContributor" date="1142181386" format="1.1" version="1.1"}%
%META:TOPICPARENT{}%
---+ Function: %TOPIC%
%FORMFIELD{"TopicDescription"}%

---++ Parameters
   * CAT: render archive links in this SubjectCategory (optional)
   * AUTHOR: render archive the archive for this author (optional)

---++ Implementation
<verbatim>
%STARTINCLUDE%
*~~ 
%~~     DBSTATS{"TopicType=~'\bBlogEntry\b' AND State='published'
~~~         %IFDEFINED{"%CAT%" then="AND SubjectCategory=~'\b%CAT%\b'" glue="off"}%
~~~         %IFDEFINED{"%AUTHOR%" then="AND BlogAuthor=~'\b%AUTHOR%\b'" glue="off"}%
~~~       "
~~~       field="Date"
~~~       hidenull="on"
~~~       sort="created" reverse="on"
~~~       pattern="(\w+ \d\d\d\d)"
~~~       header="
~~~         <div class=\"blogSideBarSection blogSideBarArchive\">
~~~           <h1 class=\"blogSideBarHeader\"> Archive$percntREDDOT{\"%WEB%.%TOPIC%\"}$percnt</h1>
~~~           <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"
~~~       format="
~~~         <tr><td><ul style=\"margin-top:0px;margin-bottom:0px;\"><li>
~~~           <a href=\"%SCRIPTURLPATH{"view"}%/%WEB%/BlogArchive?mode=chron;
*~~                month=$percntENCODE{\"$key\"}$percnt\"
~~~              title=\"Archive of
~~~                %IFDEFINED{"%CAT%" then="<nop>%CAT% in" glue="off"}% $key\">
~~~             $key
~~~           </a></li></ul></td>
~~~           <td valign=\"top\" class=\"blogEntryCount\">$count</td>
~~~         </tr>"
~~~        footer="</table></div>"
~~~     }%
%STOPINCLUDE%
</verbatim>

---++ Test
<div class="alt">
%DBCALL{"%TOPIC%"}%
</div>

<div class="alt">
%DBCALL{"%TOPIC%" CAT="BlogsWorld"}%
</div>

%DBCALL{"RenderFunctionCallers"}%

<!--
   * Set ALLOWTOPICCHANGE = %MAINWEB%.BlogAdminGroup
   * Set SIDEBAR = Admin
   * Set SIDEBARARG = TopicFunction
-->


%META:FORM{name="TopicForm"}%
%META:FIELD{name="TopicType" attributes="M" title="TopicType" value="TopicFunction"}%
%META:FIELD{name="TopicDescription" attributes="M" title="TopicDescription" value="Render a list of all months that have postings."}%
