TEMPLATE CONTROL: This is the primary field used in all display templates. Field tags are empty tags, meaning that they do not contain any inner text. Please follow the XHTML syntax for empty fields which is to write them
as a single tag. (i.e. <xmod:field ... /> See example)
|
name |
Name of the field whose value you wish to insert (Required) [String value] |
|
class |
Name of the CSS Class used to style this field (Optional) [String value] |
|
default |
The value to insert if the field has no value (Optional). [String value] |
|
maxlength |
When specified, returns only the specified number of characters in the field's value appended with "..." If not specified or the value is 0 Then the full field value will be returned [Integer value] |
|
detaillink |
This attribute is only recognized when template is a "list template" (one used to display a list of items) If detaillink = true then the field will be rendered as a hyperlink, linking to the item's detail page.If detaillink = false or isn't specified, the field will be rendered as normal. ["true" or "false"] |
|
separator |
If the field contains a list of items, the character string specified will be used as the delimiter between those items. The default value is ", ". If the field doesn't contain a list, this field is ignored. |
|
usevalue |
Items in list-based fields contain a display text and a value. If "true" is specified, then the value is displayed rather than the display text. If usevalue is "false" or isn't Specified, the display text will be used. |
|
encodehtml |
This is a special attribute that you probably won't use too often, but when you need it, it comes in handy. The default value is "false" but if you set it to "true" then XMod will encode any special HTML characters it finds. You'll typically only use this attribute if you want to display HTML tags to the user. For example if we want to display the kind of information in the Example section below, we would most likely set this attribute to true. (new to version 1.2) |
|
enablescripts |
(Optional) This attribute has been added to enhance protection against XSS (Cross-Site Scripting) attacks. It is false by default. If a field is allowed to contain client-side script, you should set this attribute to true. |
|
preservelinebreaks |
(Optional) If "true" then displayed text will have its line feed characters replaced by the XHTML-compliant <br /> tag. This allows you to preserve line breaks as they were entered in the original. Typically, this is used with <textarea> controls to aid in usability where you can't expect (or don't want) the user to manually type in <br /> tags. In these scenarios, when the user hits the ENTER key in the text area, the expectation is that a line break will be inserted at that point. NOTE: This property is intended as a display aid for use with text-only or HTML-encoded values. It may interfere with field values that are intended to be interpreted as HTML by the browser. |
|
preservewhitespace |
(Optional) If "true" then, for each set of multiple spaces in the value, XMod will replace them with a space followed by a sequence of (non-breaking space) HTML entities. So, if 10 consecutive spaces are found, XMod will display 1 space followed by 9 entities. This allows you to preserve spaces as they were entered in the original. Typically, this is used with <textarea> or <input> controls to aid in usability where you can't expect (or don't want) the user to manually type in entities. NOTE: This property is intended as a display aid for use with text-only or HTML-encoded values. It may interfere with field values that are intended to be interpreted as HTML by the browser. |
<xmod:field name="fieldname" maxlength="100" detaillink="true" />
Example: Displaying An Ebook's Information:
<p>Title: <xmod:field name="Title" class="Header"/> <br>
Author: <xmod:field name="Author" class="AuthorStyle"/> <br>
<span class="Normal">
Publisher: <xmod:field name="Publisher"/>
</span><br>
Synopsis: <xmod:field name="BookBlurb" class="Normal" maxlength="200"/>