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

see: RenderFullTeaser, RenderBlogTeaser, RenderFrontTeaser, RenderPageNavigation

---++ Parameters
   * SKIP: offset into the archive
   * LIMIT: number of postings to show maximal
   * CAT: categories to extract (optional)
   * TAG: tagged entries to be extracted (optional)
   * AUTHOR: extract postings of this author (optional)

---++ Implementation
<verbatim>
%STARTINCLUDE%
~~~
%~~ DBQUERY{
~~~   "TopicType=~'\bBlogEntry\b' AND State='published'
~~~    %IFDEFINED{"%CAT%" then="AND SubjectCategory=~'\b%CAT%\b'" glue="off"}%
~~~    %IFDEFINED{"%TAG%" then="AND BlogTag=~'\b%TAG%\b'" glue="off"}%
~~~    %IFDEFINED{"%AUTHOR%" then="AND BlogAuthor=~'\b%AUTHOR%\b'" glue="off"}%
~~~   "
~~~   limit="%IFDEFINED{"%LIMIT%" then="%LIMIT%" else="5"}%" 
~~~   skip="%IFDEFINED{"%SKIP%" then="%SKIP%" else="0"}%" 
~~~   order="created" reverse="on" web="%WEB%" 
~~~   format="%DBCALL{"RenderFullTeaser" section="format" 
~~~     NAME="$topic" 
~~~     PARAMS="%IFDEFINED{"%CAT%" then="cat=%CAT%"}%"}%"
~~~   footer="
*~~      $percntDBCALL{\"$web.RenderPageNavigation\"
~~~        LIMIT=\"%IFDEFINED{"%LIMIT%" then="%LIMIT%" else="5"}%\" 
~~~        SKIP=\"%IFDEFINED{"%SKIP%" then="%SKIP%" else="0 "}%\" 
~~~        MAX=\"$count\"
~~~      }$percnt
*~~   "
~~~ }%
~~~ %DBCALL{"RenderGoogleAdsense" TYPE="text_image"}%
%STOPINCLUDE%
</verbatim>

---++ Test
<div class="alt">
%DBCALL{"%TOPIC%" SKIP="%URLPARAM{"skip"}%" CAT="BlogDev" LIMIT="1"}%
</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="" title="TopicDescription" value="Render a set of postings to leaf through"}%
