page_next / page_prev (Smarty extension functions)

These functions provide a context for the next or previous pages in a specific folder (for a given page in that folder). For example, if a folder contains pages A, B, C, and D, then the "next" page for B is C, and the "previous" page for B is A. Note that this function uses the default folder sort order; for example, if a folder is sorted in date order (most recent first), then the pages might appear as D, A, C, B. In this case, the "next" page for B is nothing, since there is NO next page in descending date sequence. The "previous" page in this instance is C.

Here's an example:

{page_prev page=$page_id folder=$page_folder_id}
The previous story is {$page.page_title}
{/page_prev}

The page= and folder= parameters are required, and should correspond to the page and folder IDs of the current page. Strictly speaking, they are not required to implement this functionality; however, their use reduces the amount of database access required, and thus improves performance.

This function is typically used to provide navigation between the various pages of a folder, though it could, of course, be used for other things.