AVR32 Linux Developer Blog

Function: RenderPageNavigation

Render a navigation to previous/next blog entries on the FrontPage

Parameters

  • SKIP: initial offset
  • LIMIT: number of items per page
  • MAX: maximum number of items
  • PARAMS: additional url parameters (optional)

Implementation

%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%

Test

Calls to 'RenderPageNavigation'

TopicForm
TopicType: TopicFunction
TopicDescription: Render a navigation to previous/next blog entries on the FrontPage
r1 - 2005-11-29 - 19:07:40 - TWikiContributor
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Atmel®, AVR® and others are registered trademarks or trademarks of Atmel Corporation or its subsidiaries.
All other trademarks are the property of their respective owners.