[pmwiki-users] [fox] only add new page when textarea is not empty

Hans design5 at softflow.co.uk
Tue Mar 9 02:54:30 CST 2010


Tuesday, March 9, 2010, 7:52:45 AM, Martin Kerz wrote:

> Furthermore, even "antrag" is not processed and thus the resulting
> page not created. I want my users to be able to leave two text areas
> blank (begruendung and kommentar), which should result to the
> non-creation of the respective pages, but should nevertheless
> process and create the page for "antrag".

i think i got a solution. try this:

do not use pagecheck=1 in the (:fox ...:) markup.
Use (:foxcheck antrag:) instead, or something just checking
the fields which need input, but not all fields.

In your Kommentar and Begruendung templates use conditionals:
In Kommentar template:

(:if ! equal {$$kommentar} '':)
...your template code goes here

In Begruendung template:

(:if ! equal {$$begruendung} '':)
...your template code goes here

This should cause the template to be empty if the text field is empty.
And Fox should not create a new page because it has not got
atemplate, i.e. it is empty.

  ~Hans




More information about the pmwiki-users mailing list