A Merge-Field is a locator which
has to be replaced by a single data item.
It has a name which enables you to identify it and parameters can be supplied
in order to change the display behavior.
The definition of a Merge-Field is case insensitive.
Parameter |
Description |
frm=format |
Specify a display format for a data
item which is numeric or date/hour. The format is a string built
by keywords that will be replaced with their value.
Date/hour Format:
It is VisualBasic like. The following keywords are recognized :
- d, dd,
ddd, dddd
: number of the day, number of the day with two digits, short name
of the day, full name of the day.
- m, mm,
mmm, mmmm
: number of the month, number of the month with two digits, short
name of the month, full name of the month.
- yy, yyyy
: year with two digits, year with four digits.
- hh, nn,
ss : hours, minutes, seconds with
two digits.
Example 1 : [myfield;frm=mm/dd/yyyy]
will display 12/21/2002.
Example 2 : [myfield;frm='yyyy-mm-dd
hh:nn:ss'] will display 2002-12-21
15:45:03.
Simple quotes are necessary because of the space.
Numeric Format:
It is a string which possibly contains a decimal separator, possibly
a thousand separator. Numbers are replaced with representative zeros.
Example 1 : [myfield;frm=0.0000]
will display 32456.1415.
Example 2 : [myfield;frm='000
000,00'] will display 32 456,14.
Simple quotes are necessary because of the space. |
max=val |
Indicates the maximum number of characters
to display. Beyond this limit, the data item is cut and an ellipsis
(...) is added at the bottom. |
htmlconv=val |
Enables you to force or prevent the conversion
of the data item to HTML text.
The value val
can be one of the following keywords:
yes
: (default value) force the conversion to HTML with new lines.
nobr :
force the conversion to HTML but new lines (useful for <pre> tags
for example). no
: prevent from the conversion to HTML. Usefull to modify Javascript
code or modifiy the HTML source.
look
: convert the data item to HTML only if no HTML entities are found
inside the data item. |
. (dot) |
If the data item is empty, then an unbreakable
space is displayed. Usefull for cells in tables. |
ifempty=val |
If the data item is empty, then it is
replaced with the specified value. |
friend=tag_name |
If the data item is empty, then both
opening and closing tag_name Html
tags wich embeds the merge-field are deleted. Use friendb in
order to delete only the tag_name tag
wich is before the merge-field.
Use frienda in order to delete only
the tag_name tag wich is after the
merge-field.
Example: friendb=br if
the data item is empty, the break line placed before is deleted. |
selected |
This parameter enables you to select a
value for an HTML list (inside a form).
The Merge-Field has to be placed within the list values. When the
merge executes, this Merge-Field will be replaced with the data item
as the selected item of the HTML list. If the value doesn't already
exist in the list then it will be added. (see examples) |
comm |
This parameter enables you to widen the
bounds of the indicator up to the bounds of the commentary tag (HTML)
which embed it. <!-- [myfield;comm]
this is an example--> est stricly
identical to [myfield]
This is particulary usefull for designing the template when using
a visual HTML editor (such as Dreamweaver or FrontPage). |
file=filename |
Replace the field with the content of
the file. Filename
can be a string or an expression built with Php
variable Fields that returns the file path.
It is also possible to specify a file that is included automaticaly.
For more information, please refere to the file
inclusion chapter. |
script=filename |
Execute the script just before to replace
the locator. TinyButStrong gives a global
variable $tbs_CurrVal that contains
the text which will be displayed at the place of the locator. This
variable can be used and modified with the executed script. Filename
can be a string or an expression built with Php
variable Fields that returns the file path.
If the script parameter is used with
the if parameter having a NOT verified
condition, then the script execution is canceled. |
once |
Must be used with the script
parameter. Cancel the script execution if it has previously been called. |
if expr1=expr2 |
Display the data item only if the condition
is verified.
If expr1 and expr2
are a same string (not case sensitive), then the data item is displayed.
Otherwise, the field is deleted. You can use !=
insteade of = in order to specifiy an
'not equal' condition. You can use the keyword [val]
inside the expressions to represente the data item.
The expressions may contain Merge-Fields. If so, then you may verify
that the embeded Merge-Fields are merged before the ones that contain
them. |
then
val1 |
If the if
parameter is definied and its condition is verified, then the data
item is replaced with val1.
You can use the keyword [val] inside
the expression to represente the data item. |
else val2 |
If the if
parameter is definied and its condition is not verified, then the
data item is replaced with val2.
You can use the keyword [val] inside
the expression to represente the data item. |
onformat=fct_name |
Enables you to define an PHP event
function which is executed just before the merge
of the field.
fct_name must be the name of an existing
PHP user function with the following syntax:
function nom_fct($FieldName,&$CurrVal)
{ ... }
$FieldName is
the name of the current field.
$CurrRec is
the current value.
The symbol & which
is placed before the name of the variable in the declaration
of the function has to be preserved in order to get this
argument passed by refrence.
Warning: if you modify this
value it
will change the current merge result.
|
protect=val |
Enbales you to protect or not the data
item to merge by replacing the characters
'[' with they corresponding Html code
'['.
The value val can
be one of the following keywords:
yes : (default
value) data item is protected.
no : data
item is not protected.
By default, all data merged with a template are protected except if it's
a file inclusion. It is strongly recommanded to protect data when it comes
from free enter like on a forum for example. |