[pmwiki-users] Zap and pagetemplate

The Editor editor at fast.st
Fri Jun 22 13:09:22 CDT 2007


On 6/22/07, Scott Smith <smackaysmith at gmail.com> wrote:

> I'm an idiot. I didn't realize Dan had answered the question on 6/19. Sorry.

If you are one, I'm a bigger one! I spent the last 15 minutes trying
to figure out what the problem was--again. Only this time I was pretty
well stumped!

In addition to
1) using standard template insertion markup {$$field}, and
2) using double quotes on ZAP parameter values

I'd add
3) recommend use of form key, esp if there is more than one form on a
page. these goes in the zapform markup and all the zap markups.
4) The if false part is completely unneeded. It was just a sample form
you could study in the source without the validation etc that makes it
more complicated.
5) Make sure you have "create" allowed for your systems page if you
are using Site.ZAPconfig, and the target group allowed for writing if
you are using Site.ZAPtargets.
6) The 2 if lines could be combined into one (see below)
7) The warn won't work properly without a placeholder to show when to
abort the form.

After I got everything going at last, I came up with this form:

(:messages:)
(:zapform key=create:)
(:zap createtemplate=Systems.TestFormTemplate create:)
||Create: ||(:input text makepage:)
||Add some text: ||(:input text txtWords:)
|| ||(:input submit:)
(:zap if1="namefmt {makepage} ? create=System.{makepage} :
warn=Invalid page format. " create:)
(:zap warn="" create:)
(:zap create="" create:)
(:zapend:)

(:pagelist group=System:)

The last line is to aid in seeing your results. (You might need to
refresh to get it accurate). I basically used your template page with
the addition of the $$'s.

Cheers,
Dan



More information about the pmwiki-users mailing list