How to create a page browser in TYPO3 extensions?
Hugh data listings can be confusing and hard to understand. That applies to search results as well as news collections, members directory or todo lists. Page browser divide listings into several parts, which make it much easier to keep track of the data. The following article describes and compares two approaches to integrate a page browser in TYPO3 extensions.
Function tslib_pibase::pi_list_browseresults()
For a considerable time, TYPO3 ships an out-of-the-box function to add a page browser to your plugin. The function pi_list_browseresults is part of the cObject and is called by:
$content .= $this->pi_list_browseresults(
$showResultCount=1,
$tableParams='',
$wrapArr=array(),
$pointerName='pointer',
$hscText=TRUE
);
Unfortunately the output of the function is a HTML table which is semantically not a proper form for a page browser. The configuration misses the power of common templating, although you could serve most needs with TypoScript wraps. To find out how to implement pi_list_browseresults, you'll either have to dig into some 3rd party extensions or search the archives for comments. Therefore we leave this function as is and turn to another approach.
Extension "Universal page browser" (pagebrowse)
The Universal page browser extension from TER is meant to be used inside your plugin as a powerful alternative to pi_list_browseresults. The styling of the page browser is done by HTML templating and is controlled by TypoScript setup. It can be used inside any extension by integrating it as a USER or USER_INT cObject. (Details on how to do that are perfectly explained in one of Dmitrys blog postings). Additional hooks give you the possibility to keep control of the generation of the page browser. The extension has a straight documentation, describing the implementation with commented code snippets.
Comparison result
Both approaches allow the integration of a page browser into your frontend plugin. The convincing documentation and the HTML styling ability of the "Universal page browser" extension finaly make the difference, especially if you rather rely on standard writings than on searching for code snippets.