[pmwiki-users] Foxreplace syntax
Hans
design5 at softflow.co.uk
Sun Jan 20 06:17:11 CST 2008
Sunday, January 20, 2008, 11:41:21 AM, Randy wrote:
> Am I close? Can you show me a complete working sample of code to do
> the above task (a picture is worth a thousand words...)?
sorry I have not uploaded working examples to my site.
Here is a simple replace text form, in which you need to enter both
the text to be replaced and the replacement. I guess you can adapt
that to your example:
>>frame<<
(:fox form1 foxaction=replace put=string target={$FullName}:)
(:foxtemplate "{$$newstring}":)
Replace (:input text mark :) with (:input text newstring:) (:input submit post Post:) (:input submit cancel Cancel:)
(:foxend form1:)
>><<
foxaction=replace needs to be specified, since the default is 'add'.
I will add a note about foxaction to the cookbook page.
Any 'special markup' does not replace the basic
(:fox formname :)
...
(:foxend formname:)
markups. It will be in addition in between these two.
It is useful when using multiple times, for multi-page processing.
The above example could be written thus:
>>frame<<
(:fox form0 :)
(:foxreplace template=NewStringTemplate target={$FullName} put=string mark={$$oldstring}:)
Replace (:input text oldstring :) with (:input text newstring:) (:input submit post Replace:) (:input submit cancel Cancel:)
(:foxend form0:)
>><<
Note the parameters are moved to the (:foxreplace ... :) markup, and a
template page needed to be specified instead of
(:foxtemplate "{$$newstring}":)
Another way to write it is this:
>>frame<<
(:fox form0 :)
(:foxreplace NewStringTemplate=>{$FullName} put=string mark={$$oldstring}:)
Replace (:input text oldstring :) with (:input text newstring:) (:input submit post Replace:) (:input submit cancel Cancel:)
(:foxend form0:)
>><<
template= and target= are replaced with TmplPage=>TargetPage syntax.
This is just a shorthand syntax.
Hope this helps for a start!
~Hans
More information about the pmwiki-users
mailing list