[pmwiki-devel] page text variables across groups with Attach:

John Rankin john.rankin at affinity.co.nz
Wed Dec 15 16:45:17 CST 2010


On 16/12/10 10:34 AM, Peter Bowers wrote:
> On Wed, Dec 15, 2010 at 10:11 PM, John Rankin
> <john.rankin at affinity.co.nz>  wrote:
>> The following page text variable is on GroupA.Page1:
>>
>> (:graphic: Attach:an-image.png :)
>>
>> On GroupB.Page2, we have a custom directive (:bookmetadata GroupA.Page1:) that generates
>> a table of metadata names and values, including:
>>
>> || graphic||{GroupA.Page1$:graphic} ||
>>
>> This produces a link to uploads/GroupB/an-image.png, whereas we would like it to produce a link
>> to uploads/GroupA/an-image.png. The code works correctly if the (:bookmetadata:) directive is
>> on GroupA.Page2 -- the problem arises when we retrieve the graphic PTV from a different group.
>>
>> Is there a way, preferably easy, to do this?
> According to http://www.pmwiki.org/wiki/PmWiki/Uploads under the
> heading "Attachments on other pages and groups" you can use this
> syntax:
>
> Attach:Groupname./file_name.ext (note the dot after the groupname)
>
> Does that work?
Yes and no. Attach:Groupname/an-image.png (without a dot!) correctly 
references an image in a different group's uploads directory. But 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, if 
that's what the author entered -- I can't rely on people remembering to 
insert a groupname when they set up a (:graphic: Attach:an-image.png :) PTV.

And I do not understand the difference between 
Attach:Groupname./file.ext and Attach:Groupname/file.ext, since the 
latter seems to work.


John




More information about the pmwiki-devel mailing list