District Core Developer DocsDistrict Core Developer Docs
Developers
Boilerplate
Modules
Bitbucket
Developers
Boilerplate
Modules
Bitbucket
  • Modules

    • ABN
    • ActivityLog
    • AnalyticsApi
    • ApiConnector
    • BlockApi
    • CategoryApi
    • CloneApi
    • CommentApi
    • ContentApi
    • Core
    • Documents
    • EmbedApi
    • Event
    • ExportApi
    • FeatureApi
    • FormApi
    • GTM
    • GalleryApi
    • HelpApi
    • Hotspot
    • IdeaSurvey
    • ImportApi
    • InteractionsApi
    • Intercom
    • MailApi
    • MapApi
    • MapSurvey
    • MediaApi
    • MenuApi
    • MetaTagApi
    • NlpApi
    • NotificationApi
    • Page
    • ParentableContent
    • PaymentApi
    • PermissionsApi
    • Postcode
    • ReCaptcha
    • Redirects
    • Renderer
    • ReportApi
    • RestrictionApi
    • RevisionApi
    • SearchApi
    • Settings
    • ShareableApi
    • Slack
    • SlugApi
    • SubscribableApi
    • Survey
    • Team
    • TenantApi
    • TestApi
    • ThemeApi
    • Timeline
    • TranslationApi
    • Update
    • Users
    • VisualisationApi
    • WorkflowApi
    • Wysiwyg

FormAPI Module

The FormApi is responsible for storage and parsing of form schemas. It also manages the InputElement plugins which define the various form elements that can be used with a form (eg text, number, checkbox).

Form storage

A form is just an array of elements so the form itself is not complex at all, where things get more complex is at an individual element level.

InputElements

A single input element defines its own settings form, default settings and other properties associated with rendering the element in a submission form on the frontend (via VueFormulate). An element is responsible for converting its saved settings into a VueFormulate schema which happens just before it is passed to the frontend. It also validates settings to ensure what gets passed to the formulate converter is correct.

All input element plugins implement InputElementInterface and this should be studied for more insight on customising and extending elements.

Adding new InputElements

An input element plugin can live in any module and will be auto detected if the correct folder structure is used and the element either extends BeseInputElement or implements InputElementInterface. The path pattern for auto-detection is:

/Modules/ANY_MODULE_NAME/Plugins/InputElements/Plugins

Input elements are married to VueFormulate components

You must either use an existing VueFormulate component or create your own


Edit this page
Prev
FeatureApi
Next
GTM