[pmwiki-users] update to Attach form field type (was: More answers to:More Wikiforms)

John Rankin john.rankin at affinity.co.nz
Mon Aug 13 19:28:43 CDT 2007


On Saturday, 11 August 2007 4:44 AM, Sameer Kumar <skumar at eharch.com> wrote:
>
><snip>
>In that case, you might be better using the "hide" field type;
>for example:
> 
>:Image file:image (hide Attach:Image_$Name.png)
> 
>This will force the value of the field to be (for page 00001)
>Attach:Image_00001.png
> 
>I included the page name to guarantee a unique file name.
><snip>
> 
>The above field markup does not work.
>
I have tested this more carefully now and I think it works to
specification (although perhaps it's not what you want).

When you define the field in the template as specified above,
the content of the created page becomes 

:Image file:Attach:Image_{$Name}.png

PmWiki translates this as a link to Image_00001.png or
Image_00002.png etc. So every page has a link to a 
uniquely-named image.
 
>This is what I put in the FormTemplate:
>:Image:image (hide Attach:Image_$Name.png)
> 
>This is what I got on my Projects.Add form, without an input box:
> 
>Image:          Attach:Image_{$Name}.png
> 
And this is correct behaviour for the hide field type. 

When you say it does not work, what, precisely, do you
want it to do? I had understood that you wanted to specify
the name of the uploaded file, which this does.

-- 
JR
--
John Rankin






More information about the pmwiki-users mailing list