function.pagination.php allows you to simply include standardised, centralised and wellformed pagination links.

* requirements
** none
* suggested variables to be used
** find (if search feature is used)
*** used to limit list of items to searchcriteria
** sort_mode
*** used to define what column in the table is used to sort the data
** prev_offset
*** used to establish what item the previous page begins with
** next_offset
*** used to establish what item the next page begins with
** selector_offset
*** used to establish what item any page begins with
* limits
** none(?)


!Sample
-=php file=-
pass all pagination related variables to the smarty template

-=tpl file=-
{CODE}
{pagination find=$find sort_mode=$sort_mode}
{/CODE}


if you wish to pass many parameters to the pagination function, you can keep things clean by passing an array with all variables called '__pgn_params__'
-=php file=-
{CODE}
$pgn_params = array (
find => $find,
sort_mode => $sort_mode,
name1 => $val1,
name2 => $val2
);
smarty->assign('pgn_params', $pgn_params);
{/CODE}

-=template file=-
{CODE}
{pagination pgn_params=$pgn_params}
{/CODE}

!other notes
the offset variables do not have to be passed to the pagination function if their names are used as explained above
the template used to display pagination links, can be found in
kernel/templates/pagination.tpl
to bundle parameters in an array you __must__ use pgn_params

!See also
*((Smarty Functions))
Page History
Date/CommentUserIPVersion
16 Jan 2007 (15:02 UTC)
hiran85.233.40.1924
Current • Source
xing83.64.18.1223
View • Compare • Difference • Source
xing83.64.18.1222
View • Compare • Difference • Source