[pmwiki-users] zapform with variable key

The Editor editor at fast.st
Wed May 9 07:27:18 CDT 2007


On 5/8/07, noskule <noskule at gmx.net> wrote:
>
> hi list/dan
> I working on a zapform to enable disable pagesections, (see:
> http://netstreams.org/devel/cms/index.php/Test/GroupAttributes) works so
> far.

I've seen your work so far.  Very COOL!

> So I have three forms, one for the site, group and page. I would like to
> have the three forms side by side, so the user has an overview in which
> instance he en/disables pagesections. So I include a "Pagesection"-Page
> Template like:
>
> (:include Form.PageSectionConfig:)
>
> To get more than one form working on the same page I need to set a key
> in zapform.
>
> So I would need something like (:zapform key="{$Group}SkinSection":) or
> a unique number.

This shouldn't be a problem as page variables are processed before the
zapform markup.

> Is this somehow possible?

It seems what you really need is a way to pass a variable into the
included page to produce something like

(:zapform key=Site-SkinSection:) or
(:zapform key=<Group>-SkinSection:) or
(:zapform key=<Group>-<Name>-SkinSection:)

And then I presume you would store the settings on pages:

Site.SkinSection
Group.SkinSection
Group.Name-SkinSection

And lastly you would somehow retrieve those settings hierarchically,
looking first to the page, the group, and then the site page, if none
of the preceeding exist.  Is this correct?

Pm might have to suggest a way to pass that variable in, as he's been
reworking templates etc, in PmWiki and it might be easy to do. I'm not
sure. I would simply write up all three forms, customize the fields as
needed and include all three. But that's just because I don't know an
obvious easier way.

> other way could be to have one form ans save in multiple pages, like
> described in savedate, but how do I assing filed to a specific page?

If you are asking how to assign the page the data is stored on, you
set the datapage field to whatever page you want.  That's how the data
gets stored to the specific pages mentioned above.

I think I would use config settings to turn the sections on and off
rather than wiki sections--as config pages can also retrieve PTV's
directly from a page and you could get it to check all the pages and
in the order desired.

> thanks for any hints
> nos

This will be a very cool recipe if you can get it working.  Please be
sure to release it.

Cheers,
Dan



More information about the pmwiki-users mailing list