WM-Field |
|||||||||||||||||
|
Syntax
|
[WM-Field: fieldName] [WM-Field: fieldName raw] [WM-Field: fieldName nolink] [WM-Field: fieldName Unicode:language] [WM-Field: fieldName cgiEncoded] [WM-Field: fieldName replace(findString,replaceStr] |
||||||||||||||||
|
Example
|
Name: [WM-Field: First_Name]<br />
Tel: [WM-Field: Phone]<br />
Description: [WM-Field: JobDescription raw replace("/","-")]
|
||||||||||||||||
|
Description
|
The [WM-Field] tag is replaced by the contents of the field specified in fieldName. Using the raw attribute Using the nolink attribute Using the Unicode attribute When specifying Unicode, you must also specify a language, which can be any of the following:
For example, using this in a template: [WM-Field: MyJapaneseData Unicode:Japanese] ...will generate the text using the Unicode characters for Japanese. Using the cgiEncoded attribute For example, if we wanted to send field data to the Google search CGI we could include something like this in our template: <a href="http://www.google.com/search?q= [WM-Field: MyField cgiEncoded]">Click here</a> If your field data contained "Fourth World" the generated HTML would be: <a href="http://www.google.com/search?q=fourth+world"> Click here</a> Since the cgiEncoded attribute controls formatting in links, it cannot be used in conjunction with the raw or nolink attributes. Using the replace attribute The replace attribute is a function that tells WebMerge to replace any instances of the string in findString with the value in replaceString for the specified field. Each findString and replaceString can be any string of characters contained within quotation marks and separated by commas. You can include quote and comma characters by using the contants "quote" and "comma", respectively, concatenating with the "&" character as needed. For example, if your fied data contained: He said Hello World
...then this: [WM-Field: MyField replace("Hello World", quote&"Hello"&comma&" World!""e)]
...would generate this HTML: He said "Hello, World!"
You can have any number of comma-separated find-and replace pairs between the parentheses, each pair separated by semi-colons: [WM-Field: MyField replace("find","replace";"/","-")]
Other link attributes For example, if your template reads: [WM-Field: FieldName target="Frame"] Then the resulting link will read: <a href="detail.html" target="Frame">FieldData</a> Note about file names First introduced in version 1.0. |