Formidable reference
Contents |
Introduction
This document constitutes the Formidable Markup Language (FML) reference.
Home page of the project: http://formidable.typo3.ug
/meta
Holds the configuration that is global to the application
| Path | Data type | Required | Default | Userobj | Description | ||
|---|---|---|---|---|---|---|---|
| meta/name | string | X | The name of your XML application | ||||
| meta/form | placeholder | ||||||
| meta/form/formId | string | X | X | The ID of your Formidable application; corresponds also to the id attribute of the <form> tag | |||
| meta/form/action | string; URL | current URL | X | Url where the POST should submit the data | |||
| meta/form/onSubmit | string | Value of the html attribute onSubmit on the HTML <form> tag for this application. | |||||
| meta/form/custom | string | Additional string that will be included in the <form> tag for this application. | |||||
| meta/debug | boolean | false | If true, appends debug information at the bottom of the application; Should be used only in test environment. | ||||
| meta/displayLabels | boolean | true | True, the renderlets will have their labels automatically displayed close to them. False, they wont. | ||||
| meta/defaultLLL | string; file-path |
If you give a path to a locallang resource, Formidable will be able to understand incomplete locallang references like LLL:myfield.label by looking in the given default locallang. Example: <defaultLLL>EXT:my_extension/pi1/locallang.xml</defaultLLL> | |||||
| meta/formwrap | boolean | true |
False, to avoid the HTML <form> tag when the form is rendered. It only has sense when all your renderlets are readonly or you are using only a renderlet:LISTER.
| ||||
| Path | Data type | Required | Default | Userobj | Description | ||
| meta/debugSendMail | csv-string; email |
Emails sent via the tx_ameosformidable->sendMail() method will be diverted to the given email addresses, to ease the debugging process. Example: <debugSendMail>nimbus@darjeeling.foo, thomson@kenopee.foo</debugSendMail> | |||||
| meta/majixSpinner | string; file-path |
Alternative image for the Ajax spinner displayed to the user when waiting for an Ajax request to be processed. <majixSpinner>fileadmin/spinner.gif</majixSpinner> | |||||
| meta/libs | csv-string |
Third-party libraries to include to page when application initializes. <libs>scriptaculous, builder</libs> | |||||
| Path | Data type | Required | Default | Userobj | Description | ||
| meta/exportStyles | boolean | true | If true, the <style> tags found in your applications will be automatically exported to external files, and included in HTML head. | ||||
| meta/ajaxCharset | string | utf8 | Specify latin1 if ajax requests should be made using iso charset, instead of utf8 | ||||
| meta/keepInSession | boolean | true | If false, Formidable will not hibernate in session, reducing memory usage on the server, but also deactivating the ajax service. | ||||
| meta/accessibility | placeholder | ||||||
| meta/accessibility/useJs | boolean | true | If false, Formidable will not include the js-layer in the page. | ||||
/control
Holds objects that will be used across all the application
/control/datahandler:STANDARD
The simplest datahandler of all; does nothing except handling form posts
| Path | Data type | Required | Default | Userobj | Description | ||
|---|---|---|---|---|---|---|---|
| datahandler:STANDARD/process | placeholder | ||||||
| datahandler:STANDARD/process/beforeRender | runneable | X |
Allows to alter the array of data handled by Formidable before distributing it to renderlets, for HTML rendering. Example: <datahandler:STANDARD> <process> <beforeRender> <userobj> <php><![CDATA[ $aData = $this->getParams(); $aData["my_rdt_name"] = "This overrides the value"; return $aData; ]]></php> </userobj> </beforeRender> </process> </datahandler:STANDARD> |
||||
/control/datahandler:DB
Get and Set data to the database
| Path | Data type | Required | Default | Userobj | Description | ||
|---|---|---|---|---|---|---|---|
| datahandler:DB/tableName | string | X | The table in the database | ||||
| datahandler:DB/keyName | string | X | The uid column in the database | ||||
| datahandler:DB/i18n | placeholder | ||||||
| datahandler:DB/i18n/use | boolean | false | True, the datahandler will activate the i18n logic when handling records. | ||||
| datahandler:DB/i18n/defLangUid | int | X | Default language uid; typically 0 | ||||
| datahandler:DB/editEntry | int | X | ID of record to edit, if any | ||||
| datahandler:DB/process | placeholder | ||||||
| datahandler:DB/process/beforeInsertion | runneable | X |
Alter the array of data before insertion into the database |
||||
| datahandler:DB/process/afterInsertion | runneable | X |
Alter the array of data after insertion into the database |
||||
| datahandler:DB/process/beforeEdition | runneable | X |
Alter the array of data before insertion into the database, only if the record already exists in the database |
||||
| datahandler:DB/process/afterEdition | runneable | X |
Alter the array of data after insertion into the database, only if the record already exists in the database |
||||
| datahandler:DB/process/beforeCreation | runneable | X |
Alter the array of data after insertion into the database, only if the record don't exists in the database and is about to be created |
||||
| datahandler:DB/process/afterCreation | runneable | X |
Alter the array of data after insertion into the database, only if the record has just been created |
||||
/control/renderer:STANDARD
Displays your renderlets sequentially, one after the other.
| Path | Data type | Required | Default | Userobj | Description | ||
|---|---|---|---|---|---|---|---|
| renderer:STANDARD/style | placeholder | ||||||
| renderer:STANDARD/style | string | X | A CSS style string to include in your application. Styles are exported to an external CSS file. Allows quick'n'clean styling. |
||||
| renderer:STANDARD/style/rewrite | boolean | true |
True, renderlet names will be replaced in the style string by the corresponding html IDs <style rewrite="true"><![CDATA[ #my-rdt-name { color: red; } ]]></style> Will be rewritten to this: <style> #my-form-id[my-rdt-name] { color: red; } </style> |
||||
/control/datasources
| Path | Data type | Required | Default | Userobj | Description | ||
|---|---|---|---|---|---|---|---|
| /control/datasources | placeholder | Collection of datasource objects | |||||
/control/datasources/datasource:DB
| Path | Data type | Required | Default | Userobj | Description | ||
|---|---|---|---|---|---|---|---|
| datasource:DB/name | string | X | The datasource name. Unique in application. | ||||
| datasource:DB/sql | string | X | X |
The SQL query to be executed by the datasource. <datasource:DB name="my-ds"> <sql><![CDATA[ SELECT * from pages WHERE pid=136 ]]></sql> </datasource:DB> | |||
| datasource:DB/table | string |
Database table. Example: <datasource:DB name="my-ds"> <table>tt_news</table> </datasource:DB> | |||||
| datasource:DB/fields | csv-string |
List of fields to be queried. Example: <datasource:DB name="my-ds"> <fields>uid, title, short</fields> <table>tt_news</table> </datasource:DB> | |||||
| datasource:DB/wheres | placeholder |
Additional conditions to be added to the query. Example: <datasource:DB name="my-ds"> <fields>uid, title, short</fields> <table>tt_news</table> <wheres> <where> <term>pid</term> <comparison>=</comparison> <value>180</value> </where> </wheres> </datasource:DB> | |||||
| datasource:DB/enableFields | mixed: boolean,string | false |
Adds enable fields to the sql query automatically. (typically hidden=0 and deleted=0) | ||||
| datasource:DB/beforeSqlFilter | runneable | X |
Allows to alter the raw data array that will be used to build the SQL parts, before building the whole query. | ||||
| datasource:DB/beforeSqlExec | runneable | X |
Allows to alter the array that will be used to build the whole SQL query, before execution. | ||||
| datasource:DB/link | placeholder | Connects to an alternative DB if needed | |||||
| datasource:DB/link/host | string | Name or IP of the server hosting the alternative DB to connect to. | |||||
| datasource:DB/link/user | string | Alternative DB username | |||||
| datasource:DB/link/password | string | Alternative DB password | |||||
| datasource:DB/link/dbName | string | Alternative DB name | |||||
/control/datasources/datasource:PHPARRAY
| Path | Data type | Required | Default | Userobj | Description | ||
|---|---|---|---|---|---|---|---|
| datasource:PHPARRAY/bindsTo | runneable | X | X |
Has to return a PHP array formated this way: array( array( "column1" => "value of row 1, column 1", "column2" => "value of row 1, column 2", ), array( "column1" => "value of row 2, column 1", "column2" => "value of row 2, column 2", ), array( "column1" => "value of row 3, column 1", "column2" => "value of row 3, column 2", ), ) |
|||
/control/sandbox
Sandbox is an object holding properties and methods that will be available and persisted in both the standard and the ajax execution environments.
| Path | Data type | Required | Default | Userobj | Description | ||
|---|---|---|---|---|---|---|---|
| sandbox/extends | string; file-path |
The sandbox can extend an existing PHP class to inherit it's method and properties. <sandbox extends="EXT:my_extension/class.mysandbox.php::mysandbox" /> <sandbox> <userobj> <php><![CDATA[ var $bar = 0; function foo() { $this->bar++; } ]]></php> </userobj> </sandbox> To access the sandbox in your application, use: $this->oSandBox->foo(); |
|||||
/elements
Elements is the placeholder for all the renderlets.
| Path | Data type | Required | Default | Userobj | Description | ||
|---|---|---|---|---|---|---|---|
| elements | placeholder | Collection of renderlet objects | |||||
/elements/renderlet:*
This property-reference is appliable to all types of renderlets.
| Path | Data type | Required | Default | Userobj | Description | |||
|---|---|---|---|---|---|---|---|---|
| renderlet:*/name | string | X | Identifier for the renderlet; unique accross all the application | |||||
| renderlet:*/label | string |
Label, displayed close to the renderlet in default rendering. Example: <renderlet:TEXT name="myfield" label="LLL:EXT:myext/locallang.xml:myfield.label" /> |
||||||
| renderlet:*/dependsOn | string | Absolute name of renderlet, onto whom the current renderlet depends. For instance, if a listbox B depends on listbox A, B should declare dependsOn='A'. | ||||||
| renderlet:*/title | string | Mapped to the title HTML property. | ||||||
| renderlet:*/custom | string |
Will be inserted as-is inside the renderlet-tag. <renderlet:TEXT name="mytxt" custom=" rel='lightbox' " /> |
||||||
| renderlet:*/style | string | CSS style definition that will be encapsulated with the corresponding HTML style-attribute in your renderlet. | ||||||
| renderlet:*/class | string | CSS class definition that will be encapsulated with the corresponding HTML class-attribute in your renderlet. | ||||||
| renderlet:*/wrap | string | Wrap string like TYPO3 likes it. | ||||||
| renderlet:*/process | boolean | true | X | True, renderlet will be processed. False, it will be skipped. | ||||
| renderlet:*/readOnly | boolean | false | True, renderlet will be locked for editing. | |||||
| renderlet:*/renderOnly | boolean | false | True, renderlet will be processed and rendered, but datahandler will skip it. | |||||
| renderlet:*/defaultWrap | boolean | true | False, renderlet will not be wrapped in default <div> tag. | |||||
| renderlet:*/activeListable | boolean | false | True, renderlet will be rendered as an active form field when in lists. | |||||
| renderlet:*/activeListable | boolean | false | True, renderlet will be rendered as an active form field when in lists. | |||||
| renderlet:*/hideIfDependancyEmpty | boolean | false | True, renderlet will be rendered as hidden (display none) if it's dependancy declared property is empty (as defined by dependsOn). | |||||
| renderlet:*/validateForDraft | boolean | false | True, renderlet will have to validate even if the current form is submitted as DRAFT. | |||||
| renderlet:*/i18n | placeholder for translation settings at renderlet level. | |||||||
| renderlet:*/i18n/translate | boolean | true | False, renderlet will not be translatable (used in conjunction with /datahandler/i18n/use). | |||||
| renderlet:*/i18n/hideIfNotTranslated | boolean | false | True, renderlet will be rendered as hidden when /renderlet:*/i18n/use is true and not translated. | |||||
| renderlet:*/hideIfJs | boolean | false | True, renderlet will be rendered as hidden if Javascript is active on the client browser. | |||||
| renderlet:*/displayOnlyIfJs | boolean | false | True, renderlet will be rendered as hidden if Javascript is not active on the client browser. | |||||
| renderlet:*/data | ||||||||
| renderlet:*/data/value | string | X | Always overrides the renderlet's value. | |||||
| renderlet:*/data/defaultValue | string | X | Value of the renderlet when displaying form for the first time, and when not editing a record from the database (when in creation mode). | |||||
| renderlet:*/data/items | placeholder for renderlet items | |||||||
| renderlet:*/data/items/fromTCA | boolean | false | True, Formidable will look for items in the TCA definition for the table as defined in /datahandler/tablename (if datahandler of type DB), with a match on renderlet name = TCA column name. | |||||
| renderlet:*/data/items/item | placeholder | |||||||
| renderlet:*/data/items/item/caption | string | X | Caption for the renderlet's item. Can be an LLL reference. | |||||
| renderlet:*/data/items/item/value | string | X | Value for the renderlet's item. | |||||