[pmwiki-users] how to pass values to edit template?

Hans design5 at softflow.co.uk
Sat Mar 10 15:59:41 CST 2007

Saturday, March 10, 2007, 6:18:33 PM, SteP wrote:

> Is the {field} markup native of PmWiki, or something that Petko's 
> newmessageboxplus added? If the latter, then it's available only when
> (:input action new:) is used, correct? I was hoping that there would be a
> generic way to pass variables to a page which the page could then read and
> store. (This is an extension of the question in my OP.)

Fox is using the same syntax for its template pages, to take the
values from input fields. You could use this too to add values from
input fields to pagetextvariables:
In the template page for instance put (:Var1: {var1}:)
and use in the fox form in an input field for instance
(:input text var1 "DefaultValue":)
When the form submits the content posted to the page, or a different
target page, will have (:Var1:...:) with the value posted.

> I have two specific applications in mind:
> 1. toggle a state page variable
> 2. store an array of selected pages

> I still have no clue how to achieve #1. My page includes
> (:state:0:)
> and I would like an interactive way to toggle {$:state} and save its new
> value in the same page. I looked at fox (amazing!), but it seems to me it
> mostly provides functions for adding/removing text inside pagess, not for
> replacing a stored value.

I have so far shied away from letting Fox overwrite any content.
Anything posted will either be on a new page, or prepend or append to
a certain position on the target page.

Maybe a replace mechanism can be added, which will run a range delete
and a new posting to the same page location in one go.

Any toggle action changing part of the page text needs to do that.


More information about the pmwiki-users mailing list