[pmwiki-users] New recipe: AuxSelect
marc
gmane at auxbuss.com
Sat Jan 27 12:51:00 CST 2007
marc said...
> Martin Fick said...
> > --- marc <gmane at auxbuss.com> wrote:
> > > marc said...
>
> I can see that populating the array via a page is useful - and I have
> thought about this - but the purpose of the recipe is to maintain state
> across pages. That means that populating the array via markup entails
> the populating markup being available to all of those pages and thus
> either replicated on each appropriate page, or placed in, say, group or
> site headers. I didn't have any need for such functionality, so I
> haven't added it. In any case, it can be added via local customisation,
> if needed.
>
> Another way would be to create markup to populate a new entry for
> $AuxSelectData. (For security reasons, it wouldn't allow an existing
> entry to be overwritten.)
http://www.pmwiki.org/wiki/Cookbook/AuxSelect
I've added some markup to populate the array.
You can populate an AuxSelect array via markup:
(:auxselectdata arrayname [value1 [value2 ...]] :)
e.g.
(:auxselectdata somearray fred barney 'dino dog':)
and immediately use it:
(:auxselect test somearray text='Somearray: ':)
auxselectdata has limited use on a single page ? although the selection
will persist should recipe authors wish to use the value elsewhere ? but
it can be used in group and site headers with more effect[1].
For security reasons, you cannot overwrite an array that has already
been defined.
[1] Unfortunately, it appears that markup in group header (and site
header when defined) runs after PageText markup, so my suggestion above
about using this, in effect, as a replacement for using config.php (and
friends) doesn't hold.
--
Cheers,
Marc
More information about the pmwiki-users
mailing list