[pmwiki-users] wikiforms recipe adds "attach" field type

John Rankin john.rankin at affinity.co.nz
Wed Sep 12 19:34:30 CDT 2007

The wikiforms recipe at 
now supports Attach: markup using a new field type.

(attach extension1|extension2|...) produces a link 
to Attach:fieldvalue.extension where "extension" is 
selected from a radio button list

(attach extn) produces a link to Attach:fieldvalue.extn

(*attach ...) produces a link to [[(Attach:)fieldvalue.extension]]

For example, a FormTemplate entry like this:

:Attachment:filefield (*attach png)

generates a form field like this:

Attachment Attach:[                ].png

and produces markup like this:


Another example, a template entry like:

:Attachment:filefield (attach png|*gif|jpg)

generates a form field like this:

Attachment Attach:[                ]. ( ) png (x) gif ( ) jpg

and markup like this (ext is the selected extension):


The asterisk causes that value to be selected by default.

If the fieldvalue contains internal spaces, these are 
changed to underscores.

I have tested the code quite carefully, but as usual, 
early adopters of this new feature should be on the 
lookout for bugs.

Thanks to Kathryn Andersen for suggesting this on 
WikiFormsRecipes. I didn't implement it quite the
way Kathryn suggested, but am open to ideas for

Questions and comments welcome.
John Rankin

         /    /
        (   c'
         \  / 
     /,  /_/  
    |  & *   Wellington
    )  /    
   /  /,    
  /  (    
 |   /      

More information about the pmwiki-users mailing list