@form

A form can be rendered from Cloud CMS by identifying the definition and form key.
Forms are rendered on the client-side using Alpaca Forms.

For a working example, see: https://github.com/gitana/sdk/tree/master/app-server/appserver-form-sample

Parameters

parameter required description
definition yes the type definition QName
form yes the form key
list no the data list to populate
successUrl no the URL to redirect to upon success
failureUrl no the URL to redirect to upon failure
formId no override the system generated html form dom ID
submitTitle no set the submit button label. default is "Submit"

Response

A form is rendered into your HTML page.

Examples

Example #1: Restaurant Form

Here is an example of a form that renders the master form for the custom:restaurant content type definition.

{@form definition="custom:restaurant" form="master"/}

Example #2: Restaurant Form (post to Data List)

Here is an example of a form that renders the master form for the custom:restaurant content type definition. The form, when POSTed, will save content to the list data list.

{@form definition="custom:restaurant" form="master" list="restaurants"/}

Example #3: Restaurant Form (with success and failure URLs)

Here is an example of a form that renders the master form for the custom:restaurant content type definition.

When content is successfully saved, redirect to "/success.html". When content fails to save, redirect to "/error.html".

{@form definition="custom:restaurant" form="master" successUrl="/success.html" failureUrl="/error.html"/}