FPLTemplate

Summary: Alternative FPLTemplate() function with hooks for developers for more flexible pagelist output
Version: 2009-03-15
Prerequisites: PmWiki 2.2.0
Status: experimental
Maintainer:
Categories: Searching PageList
Discussion: FPLTemplate-Talk

Description

From PmWiki 2.2.5 this function is part of of the core pagelist.php script, with most of its features integrated. Consider this recipe obsolete.

A revised FPLTemplate function as a proof-of-concept idea for core development of the FPLTemplate function in pagelist.php

See and check out code: fpltemplate.phpΔ

For testing install fpltemplate.php as standard cookbook recipe. Doing so will make pagelist to use the included function instead of the original FPLTemplate function.

Features:

  • All features (see PageListTemplates) offered by original FPLTemplate() function are retained
  • Original function broken into 5 (sub-)functions, called in a chain, offering possibilities of adding custom functions into the chain.
  • Additional pagelist supplied by custom function can be merged with list returned by MakePageList() function
  • Additional {$$PageListCount} template variable, giving total count of pagelist before any slicing into chunks.
  • Additional optional start= parameter for (:pagelist:)
  • Additional optional (:template none:) as template section for the case of "no matches"

Notes for Developers

Comments of changes to original function are provided in the script.

Default array of functions called in turn:

SDV($FPLTemplateFunctions, array(
   'FPLTemplateLoad',      //load pagelist template
   'FPLTemplateDefaults',  //add any defaults from template to options
   'FPLTemplatePageList',  //make pagelist, calls MakePageList(), merges with previous list 
   'FPLTemplateSliceList', //slice pagelist according to start= and count= parameters
   'FPLTemplateFormat'));  //construct and return HTML formatted output 

To add a custom function into the chain define the array with the custom function added at the right place.

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

  • 2009-03-15 Fix "bygroup" format
  • 2009-02-16 Initial version

See Also

Contributors

Comments

See discussion at FPLTemplate-Talk

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.