/form/
A mobo Form describes all mobo models that the form consits of. For each mobo Form, a Semantic Form will be created.
Please note that mobo forms are much more lightweight than regular SF Forms, since most information has already been declared and inherited in mobo fields and mobo models.
Forms declare:
- Which models to use
- If the model should be implemented as a single or multiple instance template
- Which template to use / inject
- The order of these models and templates
- Visibility of templates in edit-view and reading-view
Available Properties
ID | Description |
---|---|
$abstract | If true this object is only used for inheritance and will not be created by itself. Type(s): boolean Specific to: intermediary Default: false Example:
|
$extend | This includes and extends another file of the development. Type(s): arraystring Specific to: intermediary Example:
Example:
Example:
|
$ignore | If true, this file will be ignored completely. Type(s): boolean Specific to: intermediary Default: false Example:
|
$remove | Array, containing the IDs of all items/properties to remove from current object. Type(s): array Specific to: intermediary Example:
|
description | General Description. Fields may use them as tooltips, forms can display a small description box. This depends on the used template. Type(s): string Specific to: domain Example:
|
items | Declares all models and templates that the form uses and imports them through `$extend`. Type(s): arrayobject Specific to: domain Default: {} Example:
|
itemsOrder | In case that fields have been inherited, they might not end up in the correct order. Type(s): array Specific to: domain Example:
Example:
|
naming | Provides naming conventions / guideline. Will appear on the form page itself. Type(s): string Specific to: domain Example:
|
sf_forminfo | Object, containing all SemanticForms info parameters. Type(s): object Specific to: platform External Link: Documentation Example:
|
sf_forminput | Object, containing SemanticForms #forminput options Type(s): object Specific to: platform External Link: Documentation Example:
|
sf_freetext | Decides whether the freetext textarea will be displayed below the form. Type(s): boolean Specific to: platform Default: true Example:
|
sf_summary | Decides whether the summary field will be displayed below the form. Type(s): boolean Specific to: platform Default: false Example:
|
title | Human readable title. Type(s): string Specific to: domain Example:
|
todo | If TODO notes are placed here, mobo can print them in the CLI (If the corresponding global setting is enabled). Type(s): string Specific to: domain |
type | Defines the data-type. Type(s): string Specific to: domain Valid entries: string, number, boolean, array, object Example:
|
Important Concepts
items
The items
property contains an array of all models and templates that are used by the form.
Models are imported using $extend
.
To define a model as a multiple instance template, use type
: array
and define it as items
items:
- $extend: /model/Location
- $extend: /smw_template/NetworkPrinterHeader
showForm: true # True by default, can be ommited
showPage: true # True by default, can be ommited
- type: array
items:
$extend: /model/NetworkPrinterInstallation
- $extend: /smw_template/NetworkScannerHeader
Including Templates
If you want to include templates into the form, you can do so by using $extend
to an smw_template.
- $extend: /smw_template/NetworkPrinterHeader
showForm: true # True by default, can be ommited
showPage: true # True by default, can be ommited
There are two options, both true by default:
showForm
decides if the template is rendered while displaying the form in edit modeshowSite
decides if the template should be rendered when displaying the site. (Notice: The Site has to be (re)saved through the form to make this work)
This is useful for introducion headers into a form / resulting site. If you use the HeaderTabs Extension you are required to use this.