[pmwiki-devel] PTVs using MarkupExpr, in a Pagelist

Peter Bowers pbowers at pobox.com
Mon Jan 19 00:53:05 CST 2009

> <back on-list>
> Thanks for the response Peter. Changing the parse order seems to work in
> some cases. Seems to be okay for {$variables} but not {$$variables}.
> Works with {$variables}:
>    var:{earlymx(substr {$FullName} 2 5)}
>    FullName is {$FullName}\\
>    var is {$:var}\\
>    Output:
>    var:ite.B
>    FullName is Site.Blogger-CoreTemplate
>    var is ite.B
> Doesn't work with {$$variables}:
>    var:{earlymx(substr {$$blogid} 2 5)}
>    blogid is {$$blogid}\\
>    var is {$:var}\\
>    Output:
>    var:$blog
>    blogid is blog1
>    var is $blog

Somebody else wiser than I will probably be able to tell you exactly how to
fix it.  I would have to try it out and play with it to figure out which
rule is not in the expected order or whatever.  Since I'm short on time I'll
point out the tool I would have used.  I'm sure you've got your own
debugging tools you use, but for what it's worth...

On this page:


At the very bottom of that page I have documented a modification which I
make to pmwiki.php in the MarkupToHTML() function.  Most of the time I leave
the modification commented out (this is *very* important both because
pmwiki.php should be left unmodified as well as because this debugging tool
produces a *large* amount of output when it is active) but when I have a
rule-related problem I uncomment it, load the page where the issue occurs,
comment the debug modification out again, and then examine markup.txt (the
temporary file that is created in the pmwiki directory).  Basically it
places a copy of exactly what the page looks like after each rule fires so
you can see exactly when rules fire and what effect they cause.  It takes
all the mystery out of rule-related bugs.

I reiterate that you *must* keep this modification commented out except when
you are doing a very specific debug operation -- it will destroy your
performance and fill up your hard disk otherwise...  But for a single load
of a single page it is very effective.


More information about the pmwiki-devel mailing list