Forms

Indexes form definitions so they can be easily referenced from components on different pages.

Default Config
# config.yml
...
forms:
  baseDir: forms
or
# config/forms.yml
baseDir: forms
Key Type Default Value Description
baseDir String forms

The base directory in local resources to look for forms in.

Key Type Default Value Description
allData Map<String, Object> {}

All options passed to this object.

layout String empty string

Set the default layout to be used for all Pages from this Generator. Pages can specify their own layouts, which take precedence over the Generator layout.

parallel boolean false

Improve site generation performance dramatically by rendering the pages from this Generator in parallel. There are currently thread-safety issues that may cause deadlocks, especially when in serve mode when build cycles may be executed multiple times. As such this feature should be considered highly experimental and used with caution.

theme Object null

Set a theme to be used only when rendering pages from this Generator. This can be a String to use that theme's default options set in config.yml, or an object with a key property to use those specific options for the theme.

Key Type Description
allGenerators Site Config

Configure this item with additional options merged in from config.yml, from the object at the archetype key. Dots in the key indicate sub-objects within the site config.

Form

Render one of your predefined forms, or create one inline

20: [form]

Basic Usage
# a page's Front Matter, or in any option of type ComponentHolder
...
components:
  - type: "form"
    form: null

Key Type Default Value Description
form Form null

The Form to render. Can be either a key to an indexed form definition, or a complete form definition for a one-off use.

Key Type Default Value Description
allData Map<String, Object> {}

All options passed to this object.

extraCss String[] empty array

Add extra CSS files to the page containing this Component, which will be compiled just like the rest of the site's assets.

extraJs String[] empty array

Add extra Javascript files to the page containing this Component, which will be compiled just like the rest of the site's assets.

hidden boolean false

When true, this component will not have a template rendered on the page. Useful for Components that only add extra CSS or JS, or for temporarily removing a component from the page.

noWrapper boolean false

When true, this component will not be wrapped in a wrapper element. The wrapper element is determinedby the theme, and it is up to the theme to ensure this is implemented properly.

order int 0

By default, components are rendered in the order in which they are declared, but the ordering can be changed by setting the order on any individual component. A higher value for order will render that component earlier in the list.

template String[] empty array

Specify a template or a list of templates to use when rendering this component. The first template that exists will be chosen for this component.

No archetypes

Form

Key Type Default Value Description
action String empty string

The 'action' attribute of the form. On forms which have a dedicated submission page, if this is not provided, it defaults to the URL of the submission page.

allData Map<String> {}

All options passed to this object.

attributes JSONObject {}

A map of arbitrary attributes to add to the form element.

fields FormFieldList Empty FormFieldList

The fields in this form.

method String POST

The HTTP request method the form submits as. One of ['GET', 'POST'].

methodFieldName String __method

The name of a hidden field which holds the redirection page URL

redirectionPage PageRelation com.eden.orchid.impl.relations.PageRelation@5bf8d583

The page to redirect to after a successful submission

redirectionPageFieldName String __onSubmit

The name of a hidden field which holds the redirection page URL

title String empty string

The user-facing title of the form.

No options
No archetypes

Form Fields

A field to be included in a dynamically-generated form.

Key Type Default Value Description
key String empty string

The key the field maps to in the resulting form

label String empty string

The user-facing label of this field.

order int 0

Form fields are defined in maps which do not have a defined order, and so order in which fields are rendered are not necessarily the order they are declared. Set this property to manually define the ordering of each field.

placeholder String empty string

The user-facing placeholder of this field.

required boolean false

Whether this field is required for submission.

span String auto

The number of columns this field should occupy on large screens, out of 12. Can also be 'left' (6columns, ordered from the left), 'right' (6 columns, ordered from the right), 'auto' (equivalent to 'left'), or 'full' (12 columns) The default is 'auto'.

spanSm String auto

The number of columns this field should occupy on small screens, out of 12. Can also be 'left', 'right', 'auto', or 'full', which are all 12 columns. The default is 'auto'.

template String[] empty array

A list of templates to use for this field, which takes precedence over the normal template. The first template in this lit that exists will be chosen, otherwise falling back to the default if the list is empty or none of the templates are found.

type String empty string

The field type.

No options
No archetypes

Checkbox

A checkbox, for boolean true/false input.

Key Type Default Value Description
default boolean false

The key the field maps to in the resulting form

Key Type Default Value Description
key String empty string

The key the field maps to in the resulting form

label String empty string

The user-facing label of this field.

order int 0

Form fields are defined in maps which do not have a defined order, and so order in which fields are rendered are not necessarily the order they are declared. Set this property to manually define the ordering of each field.

placeholder String empty string

The user-facing placeholder of this field.

required boolean false

Whether this field is required for submission.

span String auto

The number of columns this field should occupy on large screens, out of 12. Can also be 'left' (6columns, ordered from the left), 'right' (6 columns, ordered from the right), 'auto' (equivalent to 'left'), or 'full' (12 columns) The default is 'auto'.

spanSm String auto

The number of columns this field should occupy on small screens, out of 12. Can also be 'left', 'right', 'auto', or 'full', which are all 12 columns. The default is 'auto'.

template String[] empty array

A list of templates to use for this field, which takes precedence over the normal template. The first template in this lit that exists will be chosen, otherwise falling back to the default if the list is empty or none of the templates are found.

type String empty string

The field type.

No archetypes

Dropdown

A dropdown selector, with a list of key-value pairs as options.

Key Type Default Value Description
multiple boolean false

Whether to allow multi-select of options.

options JSONObject {}

A map of values which populate the select element.

Key Type Default Value Description
key String empty string

The key the field maps to in the resulting form

label String empty string

The user-facing label of this field.

order int 0

Form fields are defined in maps which do not have a defined order, and so order in which fields are rendered are not necessarily the order they are declared. Set this property to manually define the ordering of each field.

placeholder String empty string

The user-facing placeholder of this field.

required boolean false

Whether this field is required for submission.

span String auto

The number of columns this field should occupy on large screens, out of 12. Can also be 'left' (6columns, ordered from the left), 'right' (6 columns, ordered from the right), 'auto' (equivalent to 'left'), or 'full' (12 columns) The default is 'auto'.

spanSm String auto

The number of columns this field should occupy on small screens, out of 12. Can also be 'left', 'right', 'auto', or 'full', which are all 12 columns. The default is 'auto'.

template String[] empty array

A list of templates to use for this field, which takes precedence over the normal template. The first template in this lit that exists will be chosen, otherwise falling back to the default if the list is empty or none of the templates are found.

type String empty string

The field type.

No archetypes

Hidden

A hidden field, to submit data with the form without showing the user.

Key Type Default Value Description
value String empty string

The value of this hidden field.

Key Type Default Value Description
key String empty string

The key the field maps to in the resulting form

label String empty string

The user-facing label of this field.

order int 0

Form fields are defined in maps which do not have a defined order, and so order in which fields are rendered are not necessarily the order they are declared. Set this property to manually define the ordering of each field.

placeholder String empty string

The user-facing placeholder of this field.

required boolean false

Whether this field is required for submission.

span String auto

The number of columns this field should occupy on large screens, out of 12. Can also be 'left' (6columns, ordered from the left), 'right' (6 columns, ordered from the right), 'auto' (equivalent to 'left'), or 'full' (12 columns) The default is 'auto'.

spanSm String auto

The number of columns this field should occupy on small screens, out of 12. Can also be 'left', 'right', 'auto', or 'full', which are all 12 columns. The default is 'auto'.

template String[] empty array

A list of templates to use for this field, which takes precedence over the normal template. The first template in this lit that exists will be chosen, otherwise falling back to the default if the list is empty or none of the templates are found.

type String empty string

The field type.

No archetypes

Radio Buttons

A list of radio buttons with key-value pairs as options.

Key Type Default Value Description
options JSONObject {}

A map of values which populate the radio buttons.

Key Type Default Value Description
key String empty string

The key the field maps to in the resulting form

label String empty string

The user-facing label of this field.

order int 0

Form fields are defined in maps which do not have a defined order, and so order in which fields are rendered are not necessarily the order they are declared. Set this property to manually define the ordering of each field.

placeholder String empty string

The user-facing placeholder of this field.

required boolean false

Whether this field is required for submission.

span String auto

The number of columns this field should occupy on large screens, out of 12. Can also be 'left' (6columns, ordered from the left), 'right' (6 columns, ordered from the right), 'auto' (equivalent to 'left'), or 'full' (12 columns) The default is 'auto'.

spanSm String auto

The number of columns this field should occupy on small screens, out of 12. Can also be 'left', 'right', 'auto', or 'full', which are all 12 columns. The default is 'auto'.

template String[] empty array

A list of templates to use for this field, which takes precedence over the normal template. The first template in this lit that exists will be chosen, otherwise falling back to the default if the list is empty or none of the templates are found.

type String empty string

The field type.

No archetypes

Text

A simple text field, which may optionally be any of tht HTML5 textual input types.

No options
Key Type Default Value Description
key String empty string

The key the field maps to in the resulting form

label String empty string

The user-facing label of this field.

order int 0

Form fields are defined in maps which do not have a defined order, and so order in which fields are rendered are not necessarily the order they are declared. Set this property to manually define the ordering of each field.

placeholder String empty string

The user-facing placeholder of this field.

required boolean false

Whether this field is required for submission.

span String auto

The number of columns this field should occupy on large screens, out of 12. Can also be 'left' (6columns, ordered from the left), 'right' (6 columns, ordered from the right), 'auto' (equivalent to 'left'), or 'full' (12 columns) The default is 'auto'.

spanSm String auto

The number of columns this field should occupy on small screens, out of 12. Can also be 'left', 'right', 'auto', or 'full', which are all 12 columns. The default is 'auto'.

template String[] empty array

A list of templates to use for this field, which takes precedence over the normal template. The first template in this lit that exists will be chosen, otherwise falling back to the default if the list is empty or none of the templates are found.

type String empty string

The field type.

No archetypes

Textarea

A textarea for long-form input.

Key Type Default Value Description
cols int 0

The initial width of the textarea in average character columns.

rows int 0

The initial height of the textarea in rows.

Key Type Default Value Description
key String empty string

The key the field maps to in the resulting form

label String empty string

The user-facing label of this field.

order int 0

Form fields are defined in maps which do not have a defined order, and so order in which fields are rendered are not necessarily the order they are declared. Set this property to manually define the ordering of each field.

placeholder String empty string

The user-facing placeholder of this field.

required boolean false

Whether this field is required for submission.

span String auto

The number of columns this field should occupy on large screens, out of 12. Can also be 'left' (6columns, ordered from the left), 'right' (6 columns, ordered from the right), 'auto' (equivalent to 'left'), or 'full' (12 columns) The default is 'auto'.

spanSm String auto

The number of columns this field should occupy on small screens, out of 12. Can also be 'left', 'right', 'auto', or 'full', which are all 12 columns. The default is 'auto'.

template String[] empty array

A list of templates to use for this field, which takes precedence over the normal template. The first template in this lit that exists will be chosen, otherwise falling back to the default if the list is empty or none of the templates are found.

type String empty string

The field type.

No archetypes