[pmwiki-users] PVs in PTVs not resolved by PageTextVar()

Maxim maxim at smspower.org
Wed Jul 28 04:23:25 CDT 2010


I have a page (e.g. named Scans.Foo) that contains a PTV with a page
variable inside it:

:Filename:{$Name}.jpg

If I call

PageTextVar('Scans.Foo', 'Filename')

...I get:

"{Scans.Foo$Name}.jpg"

...when I want:

"Foo.jpg"

I can't pass the string through FmtPageName because that doesn't
handle this sort of string. Right now my workaround is:

$filename = strip_tags(MarkupToHTML($pagename, PageTextVar($pagename,
'Filename')));

This seems hacky, is there a better way?

Maxim



More information about the pmwiki-users mailing list