> On Wed, Dec 15, 2010 at 11:45 PM, John Rankin
> <[email protected]> wrote:
>> I don't see an easy way to tell pmwiki to retrieve the "graphic" PTV as
>> Attach:GroupA/an-image.png instead of just Attach:an-image.png
>
> [1]This code adapted from stdmarkup.php, '{$:var}' rule, to do ptv
> substitution:
>
> $foo = '{$:test}';
> $foo = preg_replace('/\\{(\\*|!?[-\\w.\\/\\x80-\\xff]*)(\\$:?\\w+)\\}/e',
> "PRR(PVSE(PageVar(\$pagename, '$2', '$1')))", $foo);
>
Thanks, Peter, that was the trick, giving:
$g = FmtPageName('$Group./', $page);
$ptv = trim(PVSE(PageVar($pagename, '$:graphics', $page)));
$ptv = preg_replace('!(Attach:)([^/]+)$!','$1'.$g.'$2',$ptv);
Example: http://www.wikipublisher.org/wiki/Cookbook/BookMetadata
--
John Rankin
_______________________________________________
pmwiki-devel mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel