Skip to main content
Version: v1 (Current)

Visual form and page builder

The dashboard includes several editors with similar names. This guide covers the current v2 FormBuilder, used to edit ModUI configuration. It does not create a portal, install a plugin, register a backend endpoint, or replace the separate registration-form editor. For ordinary hand-authored dashboard tabs/cards/fields and page saves, use ModUI page configuration.

Choose the owning editor​

Entry pointPurpose
FormField type form_builder or form-builderDispatches to the v2 visual FormBuilder and forwards the selected builder options.
Components/Mod/v2/CardElements/Builder/FormBuilder/FormBuilder.vueDirect v2 builder component; internal graph editor and parent-model output.
FormCard type form_builder or form-builderUses the distinct Components/Mod/FormCards/FormBuilder.vue card builder. Do not assume the field builder’s props/save behavior apply.
FormField type reg-form-builderUses RegFormBuilderWrapper and the registration-form workflow.
Components/Mod/FormFields/FormBuilder.vueOlder field-editor implementation; its presence does not make it the current FormField dispatch target.

The old page mixed plugin settings, ModUI schemas, table options and builder behavior. Use the current FormCard, FormField, field dispatch, and DataTable references for those contracts.

Prerequisites and permissions​

Run the editor inside the platform Vue/Pinia/browser environment with the relevant definition loaders, UI dependencies and parent model store. Give each parent store a stable feature-specific ID. The v2 builder itself creates a UUID-scoped builder store and card-model store per mounted instance, and disposes those stores on unmount; several builders need not share one editing graph.

builderPermissionFlags controls editor affordances: create/delete/resize/move for elements, cards and tabs. The default object enables those flags. cardTypes and elementTypes restrict palettes when nonempty; hideCardTypes and hideElementTypes hide specified choices. These are frontend editing restrictions, not backend authorization or a guarantee that imported schemas obey those restrictions. Validate and authorize the persisted configuration on the server.

Asset search/upload routes and assetIdentifier configure the asset-picker store. They do not grant access to assets. Because that picker store is configured at mount, verify asset context when multiple builders with different route configurations coexist.

M1 input and M2 editing graph​

M1 refers to legacy ModUI card/tab/field arrays; M2 is the builder’s graph representation. M2 contains root, a cards map and an elements map. The default graph also includes configurationBlocks, advancedCards and snippetOverrides. Cards refer to children by IDs in tabList, cardList or elementList; IDs and references must agree.

A minimal empty M2 graph matching the builder’s root structure is:

{
"root": {
"id": "root",
"title": "",
"style": "horizontal",
"showCard": false,
"columns": 12,
"cardType": "tab-list",
"tabList": []
},
"cards": {},
"elements": {},
"configurationBlocks": {},
"advancedCards": {},
"snippetOverrides": {}
}

Loading an empty root tab list creates an initial section. An absent/invalid loaded definition can instead initialize the default graph. The component’s isValidFormDefinition only checks truthy root/cards/elements and root.id/cardType; it is not full graph validation and does not check every dangling reference or supported child type. Null/malformed values can also throw before or during that shallow check and reach the mount error logger. Back up the stored value before migrating it; a displayed default layout does not prove the original schema loaded successfully.

Loading precedence​

An explicit formDefinition prop takes precedence and is treated as an M2 graph. A truthy explicit prop selects this branch even if rejected by the shallow check: accepted input loads directly, rejected input initializes a default form, and it does not fall through to the parent store. A malformed/null-like nested value may instead throw into the mount error logger. The parent-store M1 conversion path is skipped for this branch.

Otherwise the component uses element.name || name with element.column to read dataStore.getModelValue. It reads configured advancedCardLists from that object, then extracts subKey when configured. With convertTo: "m1" (the default), it converts that extracted M1 value to M2 before loading. Without a store/name or accepted graph, it initializes a default form.

This initialization runs on mount. Do not assume replacing the incoming prop or parent field later automatically reloads the editor; remount deliberately or use an explicit owner integration when changing the resource being edited.

Conversion boundaries​

M1/M2 converters map known card/field properties and supported types; they are not a universal lossless migration for arbitrary JavaScript configuration. Functions cannot survive JSON cloning. Preserve a backup and compare saved/reloaded output, IDs, conditions, actions, nested cards, choice options and unsupported fields before replacing a production schema.

Snippet children can be references such as snippet#<key>:<instanceId> with per-instance snippetOverrides, rather than ordinary card/element IDs. Conversion preserves supported references instead of expanding every snippet inline. A token is not proof that the referenced snippet exists or is permitted in the installed renderer.

Configure the editor​

PropCurrent component behavior/default
element, name, dataStoreParent binding; element.name wins over name, and element.column supplies the column.
formDefinitionOptional direct M2 input, taking precedence over store loading.
convertToDefaults to "m1"; that exact value enables M1 conversion. Other values keep graph output.
subKeyOptional wrapper key for the main converted output and extraction on store load.
advancedCardListsAdditional named card lists converted/serialized alongside the main subKey output.
displayHeaderDirect component default is false; definition-editor defaults can differ.
topLevelTabs, splitViewBoth default true.
defaultLayoutDirect component default is "lg"; editor metadata is not the runtime default contract.
tabRootInitialCardType, tabRootInitialCardListCountInitial tab child type and child-list count; count defaults to 0.
cardTypes, elementTypes, hidden-type arraysMount-time palette configuration.
builderPermissionFlagsEditor interaction flags described above.
modelNamePrefixNamed field-prefix configuration; optional choices can come from the parent model.
suggestedFieldsSuggestions supplied to the builder store when nonempty.
assetSearchRoute, assetUploadRoute, assetIdentifierPicker integration; identifier defaults to "id".
deleteElementParams, deleteCardParamsOptional remote deletion integration; materially changes deletion behavior.

The TypeScript definition/editor configuration describes configurable metadata, but it is not a runtime validator and does not override the component’s own defaults. FormField forwards an allowlist of builder properties; arbitrary props on a stored field are not automatically forwarded.

Editing, preview and Save​

The builder graph lives in its instance store. Desktop property edits update the selected graph element after a 500 ms debounce when the viewport is at least 768 px and an element is selected. This is an in-memory editing update, not a backend autosave. Mobile/modal editing uses its explicit apply/save interaction. A change can be pending in the desktop debounce, so verify the final property values before navigating away or saving the parent page.

Preview switches the card-model store to non-edit mode using a snapshot of the current builder graph; leaving preview restores edit mode. It does not publish a page or verify the installed portal renderer. Full-screen and responsive layout controls likewise change the editor presentation.

The component’s saveForm operation:

  1. Reads the builder graph and JSON-clones it.
  2. Converts to M1 only for exact convertTo: "m1".
  3. Wraps the main output under subKey when supplied, adding converted nonempty advanced lists alongside it.
  4. Calls dataStore.setModelValue({ name, column }, output, true) when a store and effective name exist.

Without that store/name binding, this method does not write a parent value. Although save is declared as an emitted event, its emission in this method is commented out. Listening for @save alone does not implement persistence. The declared v-model is also not assigned by this save path. Integrate through the actual parent-model binding and save the owning page/resource using its authorized endpoint.

The store’s saveForm() returns its graph; saveFormAction() invokes the installed component save hook. Element updates and other graph operations call that hook as part of editing. The template’s standalone Save button is commented out; displayHeader does not enable an independent persistence button. The component does not expose a public imperative saveForm/flush API through defineExpose. A direct mount must retain the supported store/name binding and integrate with the editor’s existing edit/save-hook flow; do not rely on calling private script-setup methods through a component ref. Desktop edits should be allowed to settle for at least the 500 ms debounce, then the owner should inspect the resulting bound value/dirty state before submitting its page. There is no documented synchronous flush guarantee in this component. Seeing an updated parent model or dirty field means the editor output was recorded locally, not committed to the database. Parent page saving has its own validation, upload and multi-request behavior; see save coordination.

Bound field example​

Within a ShowPage/FormCard field definition backed by a real model store, use this JavaScript configuration for M1 settings stored in a parent settings field:

const builderField = {
type: 'form-builder',
name: 'settings',
label: 'Settings editor',
convertTo: 'm1',
subKey: 'additionalTabs',
displayHeader: true,
topLevelTabs: true,
defaultLayout: 'lg',
}

The parent value must have the expected shape, for example { settings: { additionalTabs: [], settings: [] } }. The outer settings is the model field; the inner settings is a sibling schema surface, not a second binding column. Saving a subKey output constructs a new object; arbitrary sibling keys are not automatically merged back. Configure required advanced lists or preserve other data explicitly in the owner integration. For example, before persisting an edited output, the owner can merge an original settings snapshot with that output as { ...originalSettings, ...builderOutput }; this preserves unrelated top-level siblings while replacing the edited additionalTabs. Perform this only against the backend’s accepted configuration keys and retain deliberate deletions. It is an owner-side merge, not behavior the builder supplies automatically. The component tests cover multiple builders and conversion, not a live plugin-version update through this example.

Deletion and destructive integrations​

Without remote delete configuration, deletion changes the graph and uses the model save hook. With deleteElementParams, the store removes the element from its parent list before issuing the configured Axios DELETE; successful completion removes the element map entry. A failed request shows an error but this path does not restore the removed parent reference. Card deletion has its own recursive deletion/remote integration. Treat these paths as potentially destructive resource operations, not a universal undoable canvas edit.

Only configure remote delete routes for the intended resource with backend authorization and ID scoping. Verify successful and denied deletion, nested children and recovery from failed requests in a disposable project. The source checks for this guide sent no remote delete requests.

Plugin settings and portal output​

A plugin version’s settings.settings and settings.additionalTabs define dashboard configuration UI consumed by the project Page editor. They are not the same object as a page instance’s custom_vars, nor a universal standalone portal layout. Bind configuration values to the backend-accepted page fields/columns and select/install the intended plugin version. The stored settings guide explains their placement.

Fields such as readonly, hidden or secret-key presentation do not establish server validation or confidentiality. Required conditions and UI previews also do not enforce the public portal’s data model. Test the saved page through its actual installed plugin/renderer and permissions.

Troubleshooting and acceptance​

SymptomCheck
Default empty layout replaces expected contentInspect mount errors, direct-prop precedence, subKey, input format and shallow graph validity before saving.
Edited output does not persist remotelyConfirm effective name/store binding and the parent page’s actual save endpoint. @save/v-model alone does not implement this path.
Some settings disappear on saveCompare converter output and subKey wrapping; backup arbitrary sibling keys and unsupported properties.
Two builders edit each other’s dataCheck distinct parent field names and store namespaces; current builder instance stores are UUID-scoped.
Last desktop edit is missingWait for/check the 500 ms element-edit update and inspect the parent serialized output.
Forbidden elements remain in an imported schemaPalette/interaction flags are not schema validation or server authorization.
Delete fails and layout changes anywayInspect local parent-list mutation and the remote response; no generic rollback is promised.
Preview differs from a published pageVerify the installed version, renderer, assets, fonts, responsive layout and actual persisted schema.

Before migrating a supported feature, save a copy of its raw configuration; load it in the intended builder; change representative field, layout, condition, snippet and nested-list values; inspect the outgoing parent model; save through the authorized endpoint; reload from the backend; and verify actual rendered output. Test denied permissions and malformed input separately. Unit conversion success does not prove arbitrary schema round trips or production portal behavior.

Source and validation scope​

Reviewed against platform commit 3b48eb675f7c8e3c4f0b87d0cd613fa7fb371093: current v2 FormBuilder props/load/save/edit/preview/cleanup paths, documented store methods, M1/M2 converters, FormField/FormCard dispatch and the builder definition metadata. Selected current tests cover instance isolation and supported conversion examples. All backend persistence, remote deletion, drag/resize usability and installed portal rendering remain environment acceptance work.

Run node .github/scripts/run-page-builder-doc-checks.mjs ../experience-portal from the documentation repository with platform Node dependencies installed. The retained checks describe the disposable harness and mocks; the review report records evidence and acceptance limits. Four suites/16 tests passed, including model binding through the installed store save hook and the documented sibling-replacement limitation.