[pmwiki-users] Fwd: zap: form components and key definition

The Editor editor at fast.st
Sun Jul 22 05:55:07 CDT 2007


On 7/21/07, noskule <noskule at gmx.net> wrote:
> hi list/dan
>
> currently I'm building forms with components, to simplify form creation.
> A form could looks like this:
>
> (:include ContenFormComponents.Title:)
> (:include ContenFormComponents.Text:)
> (:include ContenFormComponents.Categories:)
> (:include ContenFormComponents.AuthorSection:)
> (:include ContenFormComponents.SaveSection:)
>
> this works great, but the problem is that I cant use zap markup in the
> incudes, cause the need a key attribute.
>
> I could use a standard key attribute, but this would limit the use of
> form to one form in a rendered page.
>
> Is the a way to build a form count variable so i could define the form
> key like
>
>    zapform key={$fomrcount}
>
> any other working solution would be great to.
>
> thanks for any hints
> nos


This is a great idea noskule, and there may be a way to do it, but I
don't see one right off and I haven't been working in ZAP for quite
awhile...

I think you would probably have to rework the ZAP code to make this
possible. I have a comment in zap.php ~line 392 that suggests this be
done... Actually, it's probably as trivial as changing 393 to

if (isset($arg['key'])) $formkey = $arg['key'];
else $formkey = $arg['#'][3];

Not tested, but you could give it a try. If it works, let me knw!

The result should be you can (optionally) assign a value to a key in
each zap input field and it will attach it to the proper form....

Cheers
Dan

PS. Reading your post again, I may have misunderstood your question. I
think there's a way now to do substitutions (somehow) in an include,
using $$var as the syntax. But you'd have to ask Pm how this works
exactly. And I don't think he generally monitors the ZAP threads.



More information about the pmwiki-users mailing list