[pmwiki-users] Option Input on Forms (pulldown menu)

The Editor editor at fast.st
Sun Dec 3 06:49:40 CST 2006


On 12/3/06, Sivakatirswami <katir at hindu.org> wrote:
> I'm using ZAPdata (trying to) But I understand the form input it build
> on top of PMwiki forms.
>
> I'm missing something basic: what is the form mark up for an option
> button that inserts a value from a preset drop down menu... final output
> of course looks like this (three different such input buttons)
>
> <select name="todo-category"><option >Mailinglists</option>
> <option >Cybertalks</option>
> <option selected>Systems Administration</option>
> <option >HTDE</option>
> <option >Other</option>
> </select> &nbsp; Status: <select name="todo-status"><option >Open</option>
>
> <option selected>In progress</option>
> <option >On hold</option>
> <option >Completed</option>
> <option >Overdue</option>
> </select> &nbsp; Owner: <select name="todo-owner"><option
> selected>Katir</option>
> <option >Caveman</option>
> <option >Andre</option>
>
> <option >Sadhu</option>
> </select></td>
>
> But I don't see  PMwiki form input control defined for this in the Basic
> Forms documentation at Pmwiki.
>
> ??
>
> Sivakatirswami
> www.himalayanacademy.com


Try

<option >Cybertalks</option>
<option value="Systems Administration" selected>Systems Administration</option>
<option value="HTDE">HTDE</option>
<option value="Other">Other</option>

etc.

But actually, there is a way to construct these automatically, using
pagelists.  Basically, you create a Group, with one page for each
task:

TaskList.Task1
TaskList.Task2
etc.

Then construct the select box dynamically like this:

(:select name="todo-category":)
(:pagelist group=TaskList name=-RecentChanges fmt="#selectlist":)
(:selectend:)

Lastly, you need to insert this in your Site.LocalTemplates page.

----
!!!fmt=#selectlist

A simple list of select options.

[@
[[#selectlist]]
(:option value="{=$Name}":)(:keep {=$Name}:)
[[#selectlistend]]
@]

----

I made some modifications to what I have on my site to adapt to your
needs (without testing the changes), but this should.  If you set it
up this way, all you need to do update the pull down menu (anywhere in
the site it is found), you just create a new page TaskList.Task3.
Voila it will appear in all this lists, just how you want.

My suggestion was going to be that you create groups for ToDo's and
Coders, and use pull down menu's like this for your data input.

By the way, you can also make your Sidebars dynamic this way.  Put
something like this in the sidebar:

CODERS:
(:pagelist group=Coders name=-RecentChanges fmt="#simple":)

(#simple is a standard pagelist that comes with PmWiki so you don't
need to define it)

The actual pages can be blank for now (just create them), but the next
step will be to put groupfooters in each of those groups so you can
click on a page and it will automatically create the pagelist of the
tasks you want to show for that individual, status, or project.  And
then I think you will be about done with what you had in mind. Oh and
we will have to put an upgrade from in your Todo group. (My
recommendation is still one todo group, using threading to number the
tasks).

For this part, you could look at
1) the ZAP forum snippet for how to do threading.
2) the ZAP profiles snippet for how to do update forms
3) the ZAP pagelistfun snippet for some options on how to list tasks
4) and very important, do some reading on PmWiki about
PageTextVariables and how to sort a Pagelist by them.

Hope this helps you make some progress. One step at a time.

Cheers
Caveman




More information about the pmwiki-users mailing list