Availability
The Pager plugin can be downloaded from the blojsom plugins download page
.
Overview
Creates page by page view of the blog entries. It provides a filter plugin based on the URL parameter "page-num", and a Velocity template that handles rendering of the navigation links for use in the templates.
Changelog
v0.3 (07-02-2007): Moved current page and total pages calculation from Velocity template to Plugin class. Renamed FilterPlugin to PagerPlugin. Added unit tests.
v0.2 (28-02-2005): Added support for Velocity template.
v0.1 (22-09-2004): Initial release. Requires Blojsom 2.17 or later.
Installation for v0.3:
Place pagerplugin-version.jar in your /WEB-INF/lib directory.
In your global /WEB-INF/plugin.properties file, add the following line:
pager=com.mbledug.blojsom.plugin.pager.PagerPlugin
Add "pager" to one of the flavor-based plugin chains. These plugin chains can be found in the individual blog's plugin.properties file. Note that if you are using other filter plugins (e.g. calendar and limiter), then the filtering will be chained. It is recommend placing pager plugin after calendar and before limiter within the plugin chain. For example:
html.blojsom-plugin-chain=..., calendar, ..., pager, ..., limiter, ...
Installation for v0.1-0.2:
Place pagerplugin-version.jar in your /WEB-INF/lib directory.
In your global /WEB-INF/plugin.properties file, add the following line:
pager=com.mbledug.blojsom.plugin.pager.FilterPlugin
Add "pager" to one of the flavor-based plugin chains. These plugin chains can be found in the individual blog's plugin.properties file. Note that if you are using other filter plugins (e.g. calendar and limiter), then the filtering will be chained. It is recommend placing pager plugin after calendar and before limiter within the plugin chain. For example:
html.blojsom-plugin-chain=..., calendar, ..., pager, ..., limiter, ...
The Pager plugin has its own configuration file, pager.properties, that is referenced as an initialization parameter for BlojsomServlet in /WEB-INF/web.xml.
<init-param>
<param-name>plugin-pager</param-name>
<param-value>pager.properties</param-value>
</init-param>
The pager.properties file will be located in the respective /WEB-INF/blog-id directory, and contains the following key-value pairs:
page-size=4
The value of page-size determines how many entries per page.
Usage
Place the pager.vm template (included in templates directory of the jar, bin, and src downloads) into the appropriate /WEB-INF/blog-id/templates directory, and include this template from your existing blog template.
#parse( "pager.vm" )
Navigation links display can be configured by modifying pager.vm. You might want to customise the value of $first, $prev, $next, $last, and also the final display format at the end of pager.vm.