[pmwiki-users] Difficulty implementing fox forms

Hans Bracker design at softflow.co.uk
Thu Feb 2 16:28:12 CST 2012


Mike, some more details:
In your NewBill form the target parameter needed modification.
You want the new page name be build from the "payee" and "amount due"
("totdue"). Because 'totdue' quite likely has a dot as decimal marker
in it, when Fox on form submission tries to create a valid wiki page
name, it will interpret the part before the dot as a group name, and
the part after as a page name, removing any spaces and url invalid
characters. I fixed that by specifying a foxgroup parameter, thereby
setting specifically the target group. The same consideration could
actually be made for FoxContacts, if dots are used in name fields.

The other main difference from your form to the FoxContacts
NewContact form is this:
The NewContact form acts in two ways:
1. it is used to add a new contact page, using a template.
2. it is used to edit an existing contact, called by a FoxEdit link.
The editing works by updating the PTVs of the page.
These two very different functions are combined in one form, and that
needs some specific syntax constructions.
The fox template '#new' on the ContactTemplates page is used to add
PTVs and also a lengthy (:include ContactTemplates#display ... :)
directive to each new contact page. If we wanted only PTVs
added, we would not need a template, but just need to set the names
of PTVs in a list with commas separating each name to a parameter
ptvfields=. Those PTVs could be hidden (default) or in some other
visible form, using parameter ptvfmt=text or deflist, or section.

So what is the purpose of (:include ContactTemplates#display .... :)
directive? It provides a way to display the 'data' of the PTVs in the
page. Basically it displays (includes) section #display from page
ContactTemplates, and uses the values of the PTVs on the contact page
in replacement variables of this #display template section. This
might look a little obscure, but it has the advantage that we can
edit and change the display on all contact pages editing a single
template section.

Now if you look at the #display template section, you find there
among much else a foxedit link markup and  'deletelink', which refers
to a foxdelrange markup inside the (:include ContactTemplates#display ... :)
markup. The latter gets automatically expanded by Fox and is specific
to the entire text 'range' from mark #foxbegin# to mark #foxend#.
Thus we have a foxedit link and a foxdelete link. Note also that
these are noy shown to everyone, but only under certain conditions,
i.e. if you are authorise to edit the page for instance.

Finally in this very brief explanation you can see that each Contact
page has also a Comment form at the bottom, for easy adding multiple
comments. This is just a basic Fox comment form, and an add-on to
the functionality, which could be stripped.

Just notice your reply on the user list. Hope these explanations can
help in some way!


~Hans
www.softflow.co.uk




More information about the pmwiki-users mailing list