Form Fieldtype

Use this fieldtype to create a relationship with one of your site's forms.

form.png Fieldtype UI
Behold! The Form Fieldtype!

Overview

The Form fieldtype is gives your users a way to pick a form to include along with the current entry. How that form is implemented or shows up on the page is up to you.

Data Storage

The Form fieldtype stores the handle of a single form as a string, or an array of handles if max_items is greater than 1.

Templating

The Form fieldtype uses augmentation to return an instance of the Form:Create tag. All the documentation there applies to what you can do here.

{{ form_field }}
{{ fields }}
<div class="p-2">
<label>{{ display }}</label>
<div class="p-1">{{ field }}</div>
{{ if error }}
<p class="text-gray-500">{{ error }}</p>
{{ /if }}
</div>
{{ /fields }}
<button type="submit">Submit</button>
{{ /form_field }}

Options

max_items

integer

The maximum number of forms that may be selected.

mode

string

Set the UI style for this field. Can be one of 'default' (Stack Selector), 'select' (Select Dropdown) or 'typeahead' (Typeahead Field).

HR: Section
Learn More!

Learn more about Form Fieldtype in these related docs:

Docs

HR: Section
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →