[pmwiki-users] Fox preview syntax

Hans design5 at softflow.co.uk
Sun Jun 14 18:25:40 CDT 2009


Sunday, June 14, 2009, 11:15:17 PM, Randy Brown wrote:

> I'm finally trying out the Fox preview feature. It looks very
> straightforward. I put the following code in my sandbox, but the
> preview didn't display my page. Is my syntax wrong? myptv: 1 (:fox
> myform template=0 ptvtarget={*$FullName} redirect={*$FullName}":)
> (:input text myptv size=10:) %center%(:input submit post "$[Save]":)
> (:input submit cancel "$[Cancel]":) (:input submit preview
> 'Preview':) (:foxmessages:) (:foxend myform:) (:if foxpreview:)
> !!!$[Preview]:           %green%[-–\
> $[Changes have not been saved] &ndash;-] >>frame<<
> When the Preview button is pressed, the myptv line should appear below - but it doesn't:
(:foxpreview:) >>><< (:if:)


i just tested this.
template=0 prevents the preview, as preview uses  a template.
so don't use template=0 and add a foxpreviewtemplate markup like
(:foxpreviewtemplate "{$$myptv}":)

(:foxpreviewtemplate :) is only used for preview display, whereas
a (:foxtemplate  :) would be used for both posting and preview.

That will give you a preview display.
But by displaying the preview you loose the text in the input text
field. To preserve this you need to add to the form (i think before
any input fields, but i may be wrong there)
(:input default request=1:)

That will load input field defaults taken from the submitted fields.


  ~Hans




More information about the pmwiki-users mailing list