[pmwiki-users] PTVReplace not redirecting as expected

Hans design5 at softflow.co.uk
Wed Jan 9 05:02:40 CST 2008


Sunday, January 6, 2008, 6:37:33 AM, Randy wrote:

> 1) How do I suppress redirection?

> 2) Since PTVReplace doesn't allow specifying the page to redirect to,
> is there a way to detect that the Change button has been pressed, so I
> can at least use a conditional to change which sections on  
> PageWithForm are visible? (For example, to show "Click here to  
> continue...")

Thanks for the alert!
It seems PTVReplace is indeed buggy.
It also does not replace any PTV in a different format than the three
standard formats, i.e. it ignores the $PageTextVarPatterns array.
And it does not allow at present redirection to another page.

I am not sure if it is worthwhile to rewrite the script, or perhaps
better to scrap it.

I recommend to use Fox to do the PTV replacements.
It has a  built-in PTVUpdate function, you can specify multiple PTVs,
update them on one or several target pages, and redirect to any page
you wish. Your form would look something like this:

(:fox ptvform1 template=0 ptvtarget=PAGENAME redir=REDIRECTPAGE ptvfields=VARIABLE:)
(:input text VARIABLE:)
(:input submit post Change:)
(:foxend ptvform1:)

ptvtarget: set to {*$FullName} for current page.
ptvfields: this can be  a comma seperated list of var names.
If ptvfields is not given, Fox will attempt to update any PTV on the
target page(s) for which field names are given in the input form.

  ~Hans




More information about the pmwiki-users mailing list