@tanglemedia/directus-collection-form
v0.0.3
Published
Installs the Form Collection to your Directus project.
Downloads
147
Readme
@tanglemedia/directus-collection-form
Installs the Form Collection to your Directus project.
The package will install the following collections:
- Form Collection
tngl_form - Form Rows
tngl_form_rows - Form Field
tngl_form_field - Form Repeater
tngl_form_rptr - Form Repeater Rows
tngl_form_rptr_rows - Form Text
tngl_form_text
It automatically sets the following:
- Creates a new role called Website. If the Website role already exist, it will not create a new one.
- Website role will have READ permission to all the collections mentioned above
- Sets default presets when viewing a list of forms and fields
Requirements
- Directus >= 10.10.1
- Node >= 18.x.x
Install
npm i @tanglemedia/directus-collection-formnpx directus bootstrapto update your database and restart directus
What's inside the package
FORM COLLECTION
- Status (defaults to "Draft")
- Title (required, unique)
- Field Rows (can be a field, repeater, or text)
- Is Encrypted
- Is Recaptcha
- NoIndex
- Submit Button Text
- Submission
- Title
- Message / Content
FORM FIELD
- Interface which can be one of the following:
- Regular Input
- Number Input
- Textarea
- DateTime
- Dropdown Select
- Checkboxes
- File Upload
- Toggle
- Signature
- Sort
- Enable (show/hide a field)
- Required (make a field required or not)
- Label
- Notes
Input fields (available fields if Regular Input interface is selected)
Type:
- Text
- Phone Number
- URL
If Text is selected, the admin can enter max length of the text input
Number fields (available fields if Number Input interface is selected)
- Minimum value
- Maximum value
- Step
Datetime fields (available fields if DateTime interface is selected)
Type:
- Datetime
- Date
- Time
Choice-Based fields (available fields if Dropdown Select and Checkboxes interface is selected)
- Options
Textarea fields
- Textarea Maximum Length
Multiple fields (available fields if Dropdown Select, Checkboxes, File Upload interface is selected)
The admin can enable multiple to allow user to select multiple choices on a dropdown select and checkbox It can also allow the admin to enable multiple file uploads in the file uploads field.
FORM TEXT
For adding text inside the form (e.g. instructions, headings, etc.)
- Sort
- Enable
- Text
FORM REPEATER
For allowing user to enter multiple group of the same fields
- Sort
- Enable
- Label
- Notes
- Field Rows (can be a field, repeater, or text)
- Add Button Text
- Remove Button Text
