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

---++ Parameters
   * SKIP: initial offset
   * LIMIT: number of items per page
   * MAX: maximum number of items
   * PARAMS: additional url parameters (optional)

---++ Implementation
<verbatim>
%STARTINCLUDE%
~~~
<!--
<noautolink>
%CALC{"$SET(theNextSkip,$EVAL(%SKIP%+%LIMIT%))$SET(thePrevSkip,$EVAL(%SKIP%-%LIMIT%))$IF($GET(thePrevSkip)<0,$SET(thePrevSkip,0))"}%
</noautolink>
-->
<div class="blogNavigation">
<table border="0" cellpadding="0" cellspacing="0"><tr>
<td class="blogPrev">
~~~ <a style="%CALC{"$IF(%SKIP%==0,display:none)"}%" 
~~~    href="?skip=%CALC{"$GET(thePrevSkip)"}%;limit=%LIMIT%
*~~    %IFDEFINED{"%PARAMS%" then=";%PARAMS%"}%">
*~~    &#171;&nbsp;previous page
~~~ </a>
</td>
<td class="blogNext">
~~~ <a style="%CALC{"$IF($GET(theNextSkip)>=%MAX%,display:none)"}%" 
~~~    href="?skip=%CALC{"$GET(theNextSkip)"}%;limit=%LIMIT%
*~~    %IFDEFINED{"%PARAMS%" then=";%PARAMS%"}%">
*~~    next page&nbsp;&#187;
~~~ </a>
</td>
</tr></table>
</div>
*~~
%STOPINCLUDE%
</verbatim>

---++ Test
<div class="alt">
%DBCALL{"%TOPIC%" SKIP="%URLPARAM{"skip" default=" 0"}%" LIMIT="10" MAX="200"}%
</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 navigation to previous/next blog entries on the FrontPage"}%
