> On Wed, Dec 15, 2010 at 11:45 PM, John Rankin > <john.ran...@affinity.co.nz> 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 pmwiki-devel@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-devel