Difference between revisions of "Form templates"
Jump to navigation
Jump to search
old>Admin |
old>Admin |
||
Line 71: | Line 71: | ||
== Example == | == Example == | ||
{header} | {header}<br/><br/><h3>{tablename}</h3><br/><br/><table class='tableForm'><br/> <tr><td style="padding: 0px; border: 0px;">{pageselector}</td></tr><br/> {default_start}<br/> <tr><br/> <td class="tableFieldTableLabel"><p font="size:3">{default_name}</p></td><br/> </tr><br/> <tr><br/> <td class="tableFieldTableValue"><br/> <p font="size:3">{default_name}</p><br/> <p>{default_help}</p><p>{default_value}</p><br/> </td><br/> </tr><br/> {default_end}<br/> {defaultField}<br/></table><br/><br/>{footer} |
Revision as of 13:17, 6 March 2013
Structure and syntax
The structure of the tags in the HTML template are
- {header}
- {tablename}
- {pageselector}
- {default_start}
- {default_name}
- {default_value}
- {default_help}
- {default_end}
- {defaultField}
- {footer}
You may also add additional tags for special fields:
- "{" + [field systemname] + "_name}"
- "{" + [field systemname] + "_value}"
- "{" + [field systemname] + "_help}"
Template handling
Templates are injected with values from the current record like this
- Try to inject [system fieldname] + [prefix]
- If failed
- Copy content from {default_start} to {default_end}
- Inject values into content copy
- Inject content copy into {defaultField}
Missing values for default_XXX tags wil automatically get appended to the template.
Relation til styling
type | class | id | content | template |
---|---|---|---|---|
tbody | PAGE_[field PageID] | Container for a single field | {default_start} / {default_end} | |
div | FieldLabel | NB_[system fieldname] | Label for field | {default_name} |
div | FieldValue | VB_[system fieldname] | Value of field / Input for field | {default_value} |
div | FieldNotes | HB_[system fieldname] | Optional help text for the field | {default_help} |
Example
{header}
<h3>{tablename}</h3>
<table class='tableForm'>
<tr><td style="padding: 0px; border: 0px;">{pageselector}</td></tr>
{default_start}
<tr>
<td class="tableFieldTableLabel"><p font="size:3">{default_name}</p></td>
</tr>
<tr>
<td class="tableFieldTableValue">
<p font="size:3">{default_name}</p>
<p>{default_help}</p><p>{default_value}</p>
</td>
</tr>
{default_end}
{defaultField}
</table>
{footer}