[pmwiki-users] Could someone summarize the programmatic use of page lists?

Peter Bowers pbowers at pobox.com
Tue Jul 5 18:20:41 CDT 2011


On Tue, Jul 5, 2011 at 12:57 PM, Ryan Varick <rvarick at gmail.com> wrote:

> Thanks for the response, but unfortunately that recipe is a bit too dense
> for me to make sense of.
>
> In particular, I do not understand the $opt parameter -- how it is built,
> what is necessary for pagelists, etc. I have a vague idea of how markup is
> translated, but I have no idea how to achieve the same effect without
> markup.
>
>
I understand the desire for a simple example which does what you want, but
for lack of such I'm afraid you are going to need to do some editing of the
recipe and putting echo statements in key places to understand what's going
on.  In particular a statement such as this:

echo "DEBUG: opt=".print_r($opt,true)."<br>\n";

when placed in the right location will be helpful for you.

I believe that you will find that a markup expression like this:

{(pagelist group=Foo order=name anotheropt=abc searchterm term2)}

will end up with an $opt having these elements:

$opt['group']='Foo'
$opt['order']='name'
$opt['anotheropt']='abc'
$opt['']=array('searchterm', 'term2')

or something like that.  You can check out Cookbook/ParseArgs for more
specifics (I'm 99.9% certain PowerTools is using ParseArgs() to handle
this).

Ultimately putting trace/debug statements into code is the way to understand
how it is working.  (Obviously you will need to do this research/learning in
a non-AJAX environment first or else switch from echo to error_log($msg, 3,
$pathname) or the equivalent.)

-Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20110705/16d617c0/attachment.html>


More information about the pmwiki-users mailing list