[pmwiki-devel] markup timing and page variable

Hans design5 at softflow.co.uk
Mon Jul 7 11:29:21 CDT 2008


Can someone tell me please what the best markup timing (when to be
processed) is for a markup directive which generates some display
according to various calculations done in the markup function - and
which should set a resulting value to a page variable, which could be
shown on the same page.

I am just having second thoughts/questions about what I did in
rater.php, the script just released with the star rating system
http://www.pmwiki.org/wiki/Cookbook/StarRater

I set the markup timing to '_begin', because if I used 'directives' I
did not get an output for the page variables defined in the markup
function. And I want to avoid that a page variable or markup
expression runs the function another time (a first time), so it is
only run once for every matching markup directive encountered.

the function returns the output with
   $RaterFmt = " ......";

   $out = MarkupToHTML($pagename, $RaterFmt);
   return Keep($out);

The PV is set earlier in the function with

       $FmtPV['$Rating'.$id] = $rating;

which passes on the calculated result to a id'ed PV.

Shall I use anything else than '_begin' in the markup definition?


Thanks in advance!

Hans




More information about the pmwiki-devel mailing list