[pmwiki-devel] set up PagetextVariables from recipe ?

The Editor editor at fast.st
Mon Jan 8 05:44:39 CST 2007


On 1/8/07, Christophe David <pmwiki at christophedavid.org> wrote:
> Is there a ready made solution to change a PageTextVariable from a recipe ?
>
> Example:
>
> In a page MyGroup.MyPreferences, I have a PagetextVariable defined with
> (:PreferredLanguage:En:).
>
> I would like to be able
>
> 1) to change its value from a recipe (to import data from an external source
> for example)
> 2) to change it from a simple link (not a form button) in any other page: An
> hyperlink "French" would set the PagetextVariable in MyGroup.MyPreferences
> to "Fr"
>
> It can of course be done by loading the page in a recipe, replacing whatever
> is needeed and saving it back, but it might be re-inventing the wheel.
>
> Any clue would be welcome.
>
> Christophe


Not sure it's what you want, but zap was designed for something like
this. That is, if you are using zap's authentication system, you could
easily allow each member to set a language preference when they
register, update it any time (using an update form), and then
automatically use that value whever they are logged in.

As for your request though, of making a clickable link that would
reset a preference "onclick", the problem would be using the link to
trigger a from submission, and then passing the link value to the
form. It could be done, but it might take some thinking.  For ex: you
could pass the language value and return page as get variables to
blank page with a zap form which simply retrieves those values, resets
the text variable and then forwards back to the return page. Two trips
to the server though...

It would be much easier however to put instead a simple pulldown menu
with all the available language options, that submits on change, and
resets your value that way.  So if you can use a pulldown menu
instead, zap could do it with little problem.

Cheers,
Dan



More information about the pmwiki-devel mailing list