[pmwiki-users] cvs names list as pagelist input

Hans design5 at softflow.co.uk
Mon Oct 5 09:07:41 CDT 2009


Monday, October 5, 2009, 11:18:55 AM, noskule wrote:

> yes, but the problem ist that the list won't be in the same order as the
> in the cvs list, or do  I miss something?

try this Mx, which calls the FPLTemplate() function directly:

$MarkupExpr['fmtplist'] = 'MXFmtPageList($pagename, @$args, @$argp)';
function MXFmtPageList($pagename, $args, $opt) {
        $csvlist = implode(',',$args);
        $plist = explode(',',$csvlist);
        foreach($plist as $i => $pn)
                $plist[$i] = MakePageName($pagename, $pn);
        $out = FPLTemplate($pagename, $plist, $opt);
        return Keep($out);
}



example:
{(fmtplist <csvpagelist> fmt=<outputformat> list=normal)}

all single arguments are taken as pagenames, not search terms.
list=normal is necessary to exclude the current page.
You may get unexpected reults if you pass pagelist parameters which
are not appropiate.


  ~Hans




More information about the pmwiki-users mailing list