[pmwiki-devel] set up PagetextVariables from recipe ?

marc gmane at auxbuss.com
Mon Jan 8 07:32:59 CST 2007


The Editor said...
> 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.

> 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 form which simply retrieves those values, resets
> the text variable and then forwards back to the return page. Two trips
> to the server though.

Presuming that we have PTV get and set functions - it's inevitable they 
will come ;-) - then it's not really that hard. One simple method is to 
use an action handler; so it behaves in a similar way to the 
PageAction's menu. You could also route to a page with a local 
customization script, if it suits - I do this kind of thing for 
confirming changed email addresses and suchlike.

I like the idea of the profile page being used for member-related data 
that is stored as PTVs.

> 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.

Yup, I've already incorporated this technique - thanks, Pm - and it's 
cool for saving real estate, but sometimes you want all the options 
presented out there in the open.

-- 
Cheers,
Marc




More information about the pmwiki-devel mailing list