[pmwiki-devel] FPLTemplate() Revision

Hans design5 at softflow.co.uk
Wed Feb 18 11:34:35 CST 2009


I have now developed the BreakPageList recipe to work with the revised
FPLTemplate, as uploaded to Cookbook. It was fun to use the new
possibilities, and much simpler to code.

This takes full advantage of the FPLTemplate function hook, so
pagelist is only called once, and delivers a number of custom
pagelist template variables, which provide for very flexible output.

It may be interesting for this revision to see an example of how a recipe
can hook into FPLTemplate:

I created a custom markup (:bplinit:), which serves to set
$FPLTemplateFunctions with the breakpagelist function put into the
sequence. This avoids a general setting in config, since we may not
want the additional function in the chain for all pages.

The function itself has a quick exit at the top
   if (!$opt['start'] == 'BPL') return;
which requires a pagelist to have 'start=BPL' as parameter to use it.

This seemed to be one straight forward possibility of hooking-in a
custom function. Maybe there are others and better ones?

For details and testing see
http://www.pmwiki.org/wiki/Cookbook/BreakPageList
and
http://www.pmwiki.org/wiki/Cookbook/FPLTemplate

Hans




More information about the pmwiki-devel mailing list