[pmwiki-devel] Looking at ZAP - tutorial quirks?

christian.ridderstrom at gmail.com christian.ridderstrom at gmail.com
Sat Feb 3 08:36:17 CST 2007


I was looking at ZAP and the tutorial:
 	http://www.fast.st/zap/pmwiki.php?n=Help.GettingStarted

The example code below from that page

 	(:zapdata:)
 	(:zapform:)
 	(:input text "Field1" {$Field1}:)
 	(:input text "Field2" {$Field2}:)
 	(:input hidden savedata "Field1,Field2":)
 	(:input submit value="Zap it!":)
 	(:zapend:)
 	Field 1: {$Field1}
 	Field 2: {$Field2}

has a few quirks that I ran into, and which I think should be mentioned 
(or fixed).

The tutorial says the code will pre-poulate the fields with pre-existing 
data, but that doesn't work if the data contains spaces for instance.

Changing the code to

 	(:input text "Field1" "{$Field1}":)
 	(:input text "Field2" "{$Field2}":)

helps - I don't know if it is a full solution.

Also note that

 	Field 1: {$Field1}
 	Field 2: {$Field2}

won't display very nice as linebreaks aren't preserved by default in 
PmWiki. (Nor should they in IMHO). Changing it to:

 	(:linebreaks:)
 	Field 1: {$Field1}
 	Field 2: {$Field2}

Gives you linebreaks for what follows.

Another funny thing is that if I insert e.g. '(: :)' in a field, I get 
linebreaks between the fields and the submit button. I don't get this bit 
at all.

If there is a testing area for ZAP I can create test cases for you there 
that illustrates these problems.

cheers
/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr


More information about the pmwiki-devel mailing list