[pmwiki-users] PageTextVariable: own "automatic variable" format

Knut Alboldt pmwiki at alboldt.de
Sat Jun 9 11:33:07 CDT 2007


Hi Patrick !

Patrick R. Michaud schrieb:
  > PmWiki's {$var} markup doesn't recognize spaces or hyphens
> in variable names...  so in order for that to work we'd also 
> have to redefine the {$var} markup.
... snip ...
> 
>   # {$var} substitutions
>   Markup('{$var}', '>$[phrase]',
>     '/\\{(\\*|!?[-\\w.\\/\\x80-\\xff]*)(\\$:?\\w[-\\w ]*)\\}/e',
>     "PRR(PVSE(PageVar(\$pagename, '$2', '$1')))");
It took a while but now I got it running. I change the Markup, so I can 
use variable names with spaces now, e.g:

:varname with spaces: value of that var

so far so good. But:
It's working, when I use {$:varname with spaces} as a reference on the 
same page.

I still got a problem if I use the refernece it in pagelisttemplates like:

[@
[[#pmprio]]
(:template first:)
(:table class=pagefieldtable:)
(:template each:)
(:cellnr class=pagefieldtablecell:)(:TABEDIT+VIEW {=$FullName}:)
(:cell class=pagefieldtablecell:){=$Name}
(:cell class=pagefieldtablecell:){=$:varname with spaces}          <<<<<
(:template last:)
(:tableend:)

{$$PageCount} Einträge gefunden
[[#pmprioend]]
@]

Here I only get the string "{=$:varname with spaces}" back.

Do I have to change something more to get the roght results ?

Thanks

Knut

(running pmwiki-2.2.0-beta52)



More information about the pmwiki-users mailing list