PmWiki | FoxDocumentation / MarkupParameters (original) (raw)

The following is a list of all parameters, which can be used inside the (:fox ....:) Fox form directive:

Optional parameter foxaction

_foxaction=display_

the output will be displayed at the page location marked with the (:foxdisplay:) or (:foxdisplay _formname_:) markup, and will not be saved to the page.

_foxaction=copy_

Instead of adding content, content will be copied, without any template processing.

_foxaction=replace_

Instead of adding content, existing content will be replaced with new content. The template will be processed and evaluated.

_foxaction=mail_

Form output will create an email message and sent it to recipients listed on target page, with help of FoxNotify.

Options for adding content (the default) or the (:foxadd ....:) markup

_put=_

a keyword designating where Fox will add the new content on the page. It defaults to bottom of a page or section. (deprecated formerly place=).

_put=top_

adding content to the top of the page (deprecated formerly #top).

_put=bottom_

adding content to the bottom of the page (default) (deprecated formerly #bottom).

_put=aboveform_

adding content above the form; the form must be part of the page, not included. (deprecated formerly #append).

_put=belowform_

adding content below the form; the form must be part of the page, not included. (deprecated formerly #prepend).

_put=above_ and _mark=STRING_

adding content above the line with a marker given with parameter _mark=STRING_.

_put=below_ and _mark=STRING_

adding content below the line with a marker given with parameter _mark=STRING_.

_put=insert_ and _mark=STRING_

adding content after (right of) a marker given with parameter _mark=STRING_.

_put=insertbefore_ and _mark=STRING_

adding content before (left of) a marker given with parameter _mark=STRING_.

Alternatively using markup as marker:

(:foxappend _formname_ :) or (:foxprepend _formname_ :)

two markups used as placement markers for posts to be appended or prepended; these take precedence over the above. Warning : this directive must have text at the top of the page, otherwise it will not work.

(:foxprepend _formname_ _#markername_ :) or (: foxappend...

extending the above by adding an anchor marker name. Using an input control to choose amongst options, and naming it foxmark, one can post to different markers according to the chosen option, for example to gather votes. See FoxVoting example.

Options for foxaction=replace, or the (:foxreplace ...:) markup:

_put=string_ and _mark=STRING_

replace first occurrence of string given with _mark=STRING_ with new content.

Example :

(:fox ReplaceString foxaction=replace put=string target={$FullName} :) (:foxtemplate "{$$newstring}":) (:input text mark :) (:input text newstring :) (:input submit post 'Post':) (:foxend ReplaceString :)

_put=all_ and _mark=STRING_

replace all occurrences of string given with _mark=STRING_ with new content.

_put=allplus_ and _mark=STRING_

replace all occurrences of string given with _mark=STRING_ with new content, even any STRING found in fox forms.

_put=regex_ and _mark=REGEX_

replace all occurrences of regular expression given with _mark=REGEX_ with new content, even any REGEX match found in fox forms.

_put=marktomark_ and _mark=STRING_ and _endmark=STRING_

replace content between two markers in page specified with parameters _mark=STRING_ and _endmark=STRING_ with new content.

_put=overwrite_

replace all content with new content.

More optional parameters:

_template=TemplatePage_ or template=TemplA,TemplB,TemplC

Fox will use TemplatePage to format the post. GroupName.TemplatePagename is allowed too. See about use of templates at Template Markup. Use template=0 if no template is required. Alternatively fox will use a one-line template string provided with parameter foxtemplate="template string" or in a directive (:foxtemplate "template string":), added between form start and end. A template page specified has priority and overrides any template string given. The template string can be only a single line. For multi-line templates create a template page.

_foxtemplate="String"_

Fox will use template String.

_target=PageName_ or target=PageA,PageB,PageC

Fox will post to page PageName instead of the current page. GroupName.PageName is allowed too. If a csv list of page names is given Fox will post to each page, using a corresponding template. See Multiple Target Pages.

_uptarget=PageName_ and _upload=1_

input from a file input box (or several) will be used to upload file(s) to target page. See Upload Files input form.

_redirect=PageName_ and _redirect=1_

After posting Fox will redirect to page PageName. The default is to stay on the current page. redirect=1 will redirect to targetpage, or last in list. redirect=URL will redirect to url string given. Note that you can specify also an anchor to redirect to a page section, and url arguments, if you want to pass on arguments or open a page with a certain action.

_newwin=1_

After posting Fox will open target in new window (or tab). Use in conjunction with the 'redirect' parameter.

_cancelredirect=PageName_

When using a Cancel button (a submit button with 'cancel' instead of 'post' as the control name) Fox will redirect to PageName. All options of redirect= apply to cancelredirect as well.

_foxfilter=filter1,filter2,filter3,.._

tells Fox to apply custom filters for preprocessing field values. See Filter Functions.

_foxfields=name1,name2,name3,.._

can be used to tell Fox which fields may possibly be not set and empty, as happens when using checkboxes. Can also be used as (:input hidden foxfields name1,name2 :).

_formcheck=name1,name2,name3,.._

will enable javascript checking if any of the fields named are empty, display a warning message and prevent posting till fields have values.

_keepinput=1_ or _keepinput=name1,name2,.._

After successful posting, all input values or values of named fields will be redisplayed in the fields. Default is that entered values will be cleared from all fields if the post was successful. If the posting was aborted, values will be redisplayed.

_pagecheck=1_

Fox will not post if target page exists.

_pagecheck=PageName1,PageName2,.._

Fox will not post if any of the named pages exist.

_foxcheckmsg=String_

Message displayed with markup (:foxmessages:) after an input error raised by (:foxcheck ...:) markup. Default is an error message set by config variable $FoxCheckErrorMsg = 'Please enter valid input!';

_foxsuccess=String_

Message displayed with markup (:foxmessages:) after successful posting. The target pagename can be added by using a replacement variable like {$$target} or as a link using [[{$$target}(?action=browse)]].

_foxfailure=String_

Message displayed with markup (:foxmessages:) after failed posting. The target pagename can be added as for foxsuccess above.

_if=CONDITION_

to add a condition for setting the target inside special markups (:foxadd ...:), (:foxreplace ...:), (:foxptv ...:), (:foxcopy ...:), (:foxmail ...:). If the condition is not met, the target given in the markup will be unset and the markup not processed. CONDITION can be any condition as used in PmWiki's conditional markup, and can include replacement variables like {$$var}, i.e. field name variables.

Parameters for adding and updating PTVs :

_ptvtarget=PageName_

Fox will replace the value for any PTV on page PageName for which it has an input value from a field with the PTV name. If you need to restrict the PTV update to certain named PTVs, use the next parameter as well. See also Adding and Updating PTVs.

_ptvfields=name1,name2,name3,.._

If this is given Fox will only replace values for the PTVs named. ptvtarget=PageName needs to be specified as well.

_ptvfmt=text_ or deflist, or section

Sets format of PTVs for adding new PTVs specified with ptvfields. Default is hidden PTV.

_ptvclear=name1,name2,name3,.._

On form submission any named fields which are empty (with no value, but not 0) will clear the corresponding PTVs (erasing their values). This option allows empty input on specific input fields. Normally empty input will be ignored, and in order to clear a PTV a special keyword needs to be used. This is defined with variable $FoxClearPTVFmt and defaults to the keyword NULL: input of NULL will clear a PTV.

_ptvclear=1_

as above, but effective for all input fields saving to PTVs.

_ptvupdate=1_

Fox will use target page(s) given for ptvtargets, and update PTVs on the target page corresponding to input field names if the page exists, otherwise use a template supplied to create the page. ptvtarget= does not need to be specified.