[pmwiki-users] RFC: Attachment variable syntax

Eemeli Aro eemeli at gmail.com
Fri May 7 05:47:51 CDT 2010


On 7 May 2010 12:46, Simon <nzskiwi at gmail.com> wrote:
> {*Attach:duck.jpg$Mimetype} -- referring to the type of the main page's duck
> from the sidebar (for similarity with other markup, eg {*$MyVar})

Interesting conceptual challenge here: is the * an operator for
targeting the main page, or is it a shorthand for the main page? I
think of it as a shorthand, whereas you clearly think of it as an
operator. I'm not sure which is more right.

This is actually connected to another problem I haven't solved yet.
I'm working on templatable attachment lists as an extension of
pagelists, which will require references to the previous, current and
next file, in the style of {=$Title}. Internally, these are realised
in PmWiki using the same code that makes stuff like {*$Title} work.
And because I'm silly, I figure that attachment variables ought to be
usable from normal pagelists as well.

...which means that your suggestion is probably better, as then in
templates you'd have {=Attach:duck.jpg$Filesize} for the current page
and something like {Attach:=$Filesize} for the current file.

eemeli



More information about the pmwiki-users mailing list