[pmwiki-users] Calculated PTV in forms
Hans Bracker
design at softflow.co.uk
Sun Sep 21 04:27:11 CDT 2014
Hello Kirpi,
I fully understand how one can get lost in the realm of PmWiki variable
syntax, I often struggled with exactly the same problem! And yet
the markup for PmWiki's variables are well defined. With developing Fox I
tried to follow the PmWiki conventions in this respect.
As to the use of name=$:someptv or simply $:someptv in an Input
markup (:input .... :) :
it is mentioned in PmWiki's documentation on page
http://www.pmwiki.org/wiki/Cookbook/InputDefault under section
(:input default source=... :)
as a way to get default input in a form from PTVs on other pages.
There is no mention of how this works (and I don't see good reasons
why it should), but basically when using (:input ... :) markup of any
kind any name=$:someptv or $:someptv will be rendered in HTML as an
input element with name="ptv_someptv". And if (:input default
source=... :) is used those fields will be populated with the PTV
values from a given source page.
This ptv_ prefix to the name can then be used on form submission by
the form processing engine, for instance by PmForms or Fox.
Fox will use values of such field to update a PTV called "someptv" or
even create it new. But when using it in the form as a replacement
variable like {$$name} it would need its real HTML name, i.e.
with the ptv_ prefix, like {$$ptv_someptv}.
I should try to make this clear in the Fox documentation on the page
about PageTextVariables. Or perhaps make Fox understand
PTVs in replacement variables, for example by using a syntax like
{$$:someptv}, as equivalent to {$$ptv_someptv}
This may be more intuitiv.
Thanks for bringing this to my attention!
cheers,
Hans
More information about the pmwiki-users
mailing list