[pmwiki-users] Foxreplace syntax

Hans design5 at softflow.co.uk
Sun Jan 20 04:10:52 CST 2008


Sunday, January 20, 2008, 8:01:02 AM, Randy wrote:

> I have a challenge that seems ripe for Fox's powerful new string  
> replacement feature. Unfortunately, I haven't been able to figure out
> the syntax for that feature and I can't find any code examples.

please read http://www.pmwiki.org/wiki/Cookbook/Fox#parameters
and let me know what you don't understand.

> I want to put a form on a page that allows people to check one or more
> groups and one or more pages. The form would look like:

> [  ] GroupA
> [  ] GroupB

> [  ] Page1
> [  ] Page2
> [  ] Page 3

> <Submit>

> If someone checks all boxes, I would want output like this to replace
> another section on the page that contains the form:

>   |GroupA.Page1 |GroupA.Page2 |GroupA.Page3
>   |GroupB,Page1 |GroupB.Page2 |GroupB.Page3

> But if the user only checks GroupA, Page1, and Page3, I would want the
> target section to contain:

>   |GroupA.Page1 |GroupA.Page3

> This would all be easy if the form could restrict output to  
> permutations that contain both group and page. If that's possible, I
> don't know how to do it.

The simplest solution seems to me to use six checkboxes instead of
five:

 Group A:      Group B:
[ ] Page 1    [ ] Page 1
[ ] Page 2    [ ] Page 2
[ ] Page 3    [ ] Page 3

Then you don't need to combine Group and Page values from the form.

Otherwise perhaps conditional markup can help.

To sanitise the output after the initial posting seems wrong to me.


  ~Hans




More information about the pmwiki-users mailing list