[pmwiki-users] New Recipe: StringReplace

Hans design5 at softflow.co.uk
Sun Mar 11 17:39:06 CDT 2007


Sunday, March 11, 2007, 9:45:25 PM, Kathryn wrote:

> Would it be possible to have a checkbox to toggle a variable between two
> values?

Yes. I added an example with radio buttons to the cookbook page.
The string to be replaced gets a hidden input field and the page text
var as apart of the string value, to be current.
(:input hidden str1 ":State:{$:State}:":)
The replacement strings str2 get the radio button inputs.
http://www.pmwiki.org/wiki/Cookbook/StringReplace

> And could it be done with more than one variable on a page?

Yes. Just be careful exactly what text string needs replacing.
For a page text variable (:State:0:) I used ":State:0:" avoiding
the round brackets, because I think they are messing up the link
markup if they are part of the parameter values.


Hans




More information about the pmwiki-users mailing list