[pmwiki-users] FAST Data Project done...

The Editor editor at fast.st
Tue Aug 1 17:18:25 CDT 2006


NEAT VOTING IDEA DOWN AT THE BOTTOM...

Hi Heather!

Actually, sometimes the simplest things can be a bit difficult.  There
are two parts to your problem:  one is saving the data and the other
retrieving it and then using it to pre-set the checkbox.

To save the data you should add the following fields at a minimum to
your existing form.

(:input hidden nextpage <Group.Name>:) //the page the viewer is
forwarded to after clicking submit. Leave out if you just want to
reload the same page on submit.
(:input hidden datapage <Group.Name>:) //the page the data is stored
on, ususally data-somegroup.somename.  If you leave out it will just
add data- to current group.page. Browse there to look at it once it is
saved.
(:input hidden action:) //this is what activates the data storage
recipe. Required.

To retrieve the data just enter

(:data <Group.Name>:) //the name of the data storage page is required.
This makes all the data in the data storage page available as page
variables.

Then, (:input checkbox <name> {$field}:) //replace {$field} with
whatever the name of your checkbox field was. Note:  these two lines
can be used on the same page as the form, or any other page.

MINIMUM CODE

So if you want a page you can browse to--say "MyPage.Check", and show
what the checkbox status was the last time it was clicked you can put
it all together with:

(:data Data-MyPage.Check:)  //retrieves all data, including {$test}
(:input form:) //starts the form
(:input hidden action:) //activates the data storage on submit
My checkbox: (:input checkbox test {$test}:) //sets checkbox to saved value
(:input submit value="save checkbox status":) //submits form
(:input end:) //end of form

Hope this helps!

(Note I didn't test this, but think it should work.  Follow it closely
at first then modify it step by step to avoid changing something that
has to be just right. I'd be curious to know what you are using this
for, as it seems a bit simple...

Cheers,
Caveman

Note:  You could do voting by having each page stored on
Data-CheckBox.{$AuthId} and then do two pagelists where you list all
the pages with fields = on in one and field = off in another. Change
the links to [[~name]] and it links to their office.  Or use pagelist
extensions, to give a total number of pages in each category.  Etc.
Neat idea.



On 8/1/06, Heather Logas <hlogas at telltalegames.com> wrote:
> Hey! This looks just what I've been looking for...unfortunately I am really
> green to all this and I can't quite figure out your instructions on the
> cookbook page.  I'm unclear how to do what I'm trying to do.
>
> I've installed the recipe.  Now all I want is to put a checkbox on a page,
> let the user click it, and have it stay clicked for everyone else's point of
> view.  I've gotten as far as using the built-in forms markup to make a check
> box show up.  What I'm not at all clear on is how to "activate" your recipe
> I guess.  Where do I start?  Do I first have to make a new wiki page that
> will hold the information?  All I want is the checkbox to stay checked...
>
> I'd really appreciate a pointer or two.
>
> Thanks so much, and thanks for this great looking recipe!
>
> Heather
>
> ~*~*~*~*~*~*~*~*~*~*~*~*
> Heather Logas
> www.aliens.jetgirl.net
>
> Game Design/Production, Telltale Inc.
> www.telltalegames.com
> Moooooo!  Bone: The Great Cow Race:
> http://www.telltalegames.com/products/bone_act2




More information about the pmwiki-users mailing list