Threaded Discussions

Function: RenderDocNavigation

Render a double linked list to previous and next documents

Parameters

  • NAME: topic name to which the prev-next doc navigation is displayed
  • WHERE: search parameter to restrict the linked documents
  • ORDER: criterion how to sort set of documents (created, name, ...)
  • REVERSE: invert the sorting order (on, off)
  • PARAMS: additional url parameters (optional)

Implementation

%STARTINCLUDE%
*~~ 
<div class="navigation">
<noautolink>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin-bottom:1em">
<tr>
  <td valign="top">
*~~
%~~ PREVDOC{"%NAME%" web="%BASEWEB%" 
~~~   where="%WHERE%" 
~~~   order="%IFDEFINED{"%ORDER%" then="%ORDER%"}%"
~~~   reverse="%IFDEFINED{"%REVERSE%" then="%REVERSE%"}%"
~~~   format="&#171;"
~~~ }%
*~~
  </td>
  <td valign="top" class="navPrev" width="50%">
~~~
%~~ PREVDOC{"%NAME%" web="%BASEWEB%"
~~~   where="%WHERE%" 
~~~   order="%IFDEFINED{"%ORDER%" then="%ORDER%"}%"
~~~   reverse="%IFDEFINED{"%REVERSE%" then="%REVERSE%"}%"
~~~   format="<a href=\"%SCRIPTURLPATH{"view"}%/$web/$topic
*~~     %IFDEFINED{"%PARAMS%" then="?%PARAMS%"}%\"
~~~     accesskey=\"b\"
~~~     $percntDBQUERY{topic=\"$topic\" web=\"$web\" 
~~~       format=\"title=\\"$expand(Summary)\\">$expand(Summary or Name)\"
~~~     }$percnt</a>"
~~~ }% 
~~~
  </td>
  <td valign="top" class="navNext" width="50%" align="right"> 
~~~
%~~ NEXTDOC{"%NAME%" web="%BASEWEB%"
~~~   where="%WHERE%" 
~~~   order="%IFDEFINED{"%ORDER%" then="%ORDER%"}%"
~~~   reverse="%IFDEFINED{"%REVERSE%" then="%REVERSE%"}%"
~~~   format="<a href=\"%SCRIPTURLPATH{"view"}%/$web/$topic
*~~     %IFDEFINED{"%PARAMS%" then="?%PARAMS%"}%\"
~~~     accesskey=\"f\"
~~~     $percntDBQUERY{topic=\"$topic\" web=\"$web\" 
~~~       format=\"title=\\"$expand(Summary)\\">$expand(Summary or Name)\"
~~~     }$percnt</a>"
~~~ }% 
~~~
  </td>
  <td valign="top">
*~~
%~~ NEXTDOC{"%NAME%" web="%BASEWEB%" 
~~~   where="%WHERE%" 
~~~   order="%IFDEFINED{"%ORDER%" then="%ORDER%"}%"
~~~   reverse="%IFDEFINED{"%REVERSE%" then="%REVERSE%"}%"
~~~   format="&#187;"
~~~ }%
*~~
  </td>
</tr>
</table>
</div>
*~~
%STOPINCLUDE%

Test

Calls to 'RenderDocNavigation'

Applications.ApplicationTopic
TopicType: TopicFunction
Summary: Render a double linked list to previous and next documents
TWikiApplication: DiscussionApp
r0 - 09 Aug 2007 - 10:42:05 - TWikiContributor
© giant orange extension cord that reeks hip-hop, funk & soul