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

---++ Parameters
   * LIMIT: maximal number of BlogEntries to list
   * CAT: optionally render restrict list to this category
   * AUTHOR: optionally restrict list to this author

---++ Implementation
<verbatim>
%STARTINCLUDE%
~~~ %STOPALIASAREA%
%~~ DBQUERY{"TopicType=~'\bBlogEntry\b' AND
~~~   State='published'
~~~   %IFDEFINED{"%CAT%" then="AND SubjectCategory=~'\b%CAT%\b'"}%
~~~   %IFDEFINED{"%AUTHOR%" then="AND BlogAuthor=~'\b%AUTHOR%\b'"}%"
~~~  order="createdate" reverse="on" limit="%LIMIT%" 
~~~  hidenull="on"
~~~  header="<div class=\"blogSideBarSection blogSideBarLatest\">
~~~    <div class=\"blogSideBarHeader\">
~~~    <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">
~~~      <tr><td>
~~~        <h1>
*~~          Latest$percntREDDOT{\"%WEB%.%TOPIC%\"}$percnt
*~~        </h1>
*~~      </td><td align=\"right\">
*~~        <a class=\"natFeedIcon\"
~~~           title=\"RSS Feed for the Entries on this Site\"
~~~           href=\"%SCRIPTURLPATH{"view"}%/%WEB%/WebRss\">RSS</a>
*~~      </td></tr>
*~~    </table>
~~~    </div><ul style=\"margin-top:0px;margin-bottom:0px;\"><noautolink>"
~~~  format="<li><a href=\"%SCRIPTURLPATH{"view"}%/$web/$topic\"
~~~            title=\"link to <nop>$topic\">
*~~            $formfield(Headline)</a></li>"
~~~  footer="</noautolink></ul></div>"
~~~ }%
~~~ %STARTALIASAREA%
~~~
%STOPINCLUDE%
</verbatim>

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

<div class="alt">
%DBCALL{"%TOPIC%" LIMIT="10"}%
</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 the list of recent postings in the WebSideBar"}%
%META:TOPICMOVED{by="MichaelDaum" date="1127297546" from="Blog.RenderLatestEntries" to="Blog.RenderRecentPostings"}%
