ModUI page configuration
This guide describes the platform dashboard's configuration-driven page composition: tabs, cards, fields, actions and saves. It is not a universal text-template language or a standalone portal SDK. The old “templating system” name covered several different mechanisms; use the actual owning renderer and schema when extending one.
Start with a working page in the same application context. The dashboard Vue/Inertia/Pinia environment, model props, permissions and named routes are prerequisites. A configuration object does not register a backend route, validate a resource or grant permission to save it.
Composition and reference map
| Responsibility | Owner/reference |
|---|---|
| Page shell, tab navigation, save coordination, page-level events | Components/Mod/ShowPage.vue |
| Tab/card arrangement and event forwarding | FormPanel.vue, FormCard.vue; card schema |
| Field rendering and data updates | FormField.vue; field schema, field types |
| Table loading, actions and selection | DataTable component and schema |
| In-memory values, dirty paths and defaults | Store/dataModelStore.js |
| Visual builder and conversion | Components/Mod/v2/.../FormBuilder and its M1/M2 helpers; page builder |
| Named URLs and HTTP context | Routing |
| AI-assisted field writing | AI field integration |
Detailed type names and props are renderer-specific. Do not combine an old v1 field spelling, a v2 category/style and portal-form options into one assumed universal field. Dedicated references describe their own review scope; an option's appearance in an earlier catalog does not establish consumption in every renderer.
Define a page shell
ShowPage accepts showConfig and showItem objects, plus title/layout-related props. It initializes its data model from the item and tab configuration. A small editable field configuration in an already-initialized dashboard page is:
<template>
<ShowPage :show-config="showConfig" :show-item="item" />
</template>
<script setup>
import ShowPage from '@/Components/Mod/ShowPage.vue'
defineProps({ item: { type: Object, required: true } })
const showConfig = {
tabsList: [{
tabId: 'settings',
title: 'Settings',
cards: [{
cardId: 'details',
type: 'fields_list',
showCard: true,
fieldsList: [{ name: 'name', type: 'text', label: 'Name' }],
}],
}],
}
</script>
This example configures a field; it deliberately supplies no persistence route. Add the intended authorized create/update configuration only after verifying its backend schema. Typing a value or seeing a dirty state is not a saved database change.
The page filters tabs through feature/permission checks, nonempty card arrays and conditions. Missing tab IDs are generated from the filtered index (tab-0, etc.). Supply stable explicit tabId values when links/hash navigation or changing tab visibility need stable identity. Client visibility checks are presentation controls, not a substitute for endpoint authorization.
Bind values and defaults
A field's name identifies its value. When column is supplied, the store uses a nested column.name path, for example custom_settings.heading. Keep that path aligned with the backend's accepted/persisted structure; selecting dependency_list or asset_list is not a grant to use arbitrary referenced records.
The reviewed initializer preserves stored Boolean and numeric values. Its ordinary default branch uses field.default || ..., so a falsy configured default such as numeric zero is not universally handled like a nonempty default. Functional defaults receive the field and stored state in this code path. Inspect and test the actual field/default combination instead of assuming every renderer shares one truthiness rule.
JavaScript callbacks in a page module are executable functions. A JSON configuration cannot serialize a callback merely by putting JavaScript source in a string. Use the supported declarative condition/route shapes for stored schemas and verify which consumer interprets them.
Cards, fields and presentation
A v1 fields_list card contains fieldsList; a table card and button-group card have different contracts. Custom component cards require an available Vue component and supported props/events. Arbitrary component names in stored JSON do not install or import components.
Layout, classes, gutters, conditions, feature checks, readonly and disabled settings are consumed at particular levels. The prior list of “universal” options was too broad. Inspect the actual card/field branch and related definition before using an option, including responsive layout values and CSS framework assumptions.
A dashboard configuration preview is not proof of pixel-identical portal, registration or printed output. Verify the intended installed renderer, fonts/assets and responsive behavior. Rich HTML/text interpolation also has its own consumer and escaping/sanitization behavior; a condition or {{token}} string is not automatically processed by every field. Do not use this page schema as an assumed arbitrary template evaluator.
Save, create and delete
Page save behavior comes from the actual ShowPage configuration:
updateConfig.updatesupplies route, params and optional method (defaultpatch). The page submits through a POST transport with_methodfor the intended update.createConfig.createsupplies its route, params and optional method (defaultpost). Create/updatetransformcallbacks can change the outgoing data.- A configured update
validatecallback can stop submission by returning a truthy error value passed to the toast; return no error on success. Use a suitable user-facing message and verify the consumer rather than assuming a structured server-error object. Server-side validation and authorization remain required. updateConfig.read_onlyindicates a page that saves through another path; it is not a backend deny rule.- Delete controls have their own confirmation/request contract. Do not infer safe deletion from the presence of a
deleteConfigobject or reuse an update route as a delete endpoint.
The page constructs output from tracked updated field paths rather than always posting the entire displayed model. Nested paths are reconstructed; object values are copied for output. Test omitted values, clearing a value, false/zero, nested changes and server validation errors against the actual payload. The page also coordinates large-upload extraction; the visible field value alone does not prove a completed upload.
Registered cards can participate through showPageSaveRegistry. Save flushes registered editor hooks before validation, saves dirty registered cards before the page's own request and stops if an external save throws. There is a one-save-at-a-time guard. This ordering is not an atomic transaction across separate requests: an earlier card save may succeed before a later operation fails. Inspect each resulting saved resource and preserve errors rather than retrying blindly.
Custom action events
In the reviewed button-group event path, use type: 'event_emitter' and a matching eventName. The event flows through FormCard/FormPanel to ShowPage.handleCustomEvent, which looks up showConfig.eventHandlers[eventName] and invokes it with (eventData, event).
const eventHandlers = {
inspectExample(eventData, event) {
// The button-group path supplies event.data as eventData.
// Read the event/configured context deliberately; it is not a saved model.
console.log('Example action', eventData, event?.type)
},
}
const actionCard = {
type: 'button_group',
buttons: [{
type: 'event_emitter',
text: 'Inspect',
eventName: 'inspectExample',
}],
}
Place the card in the intended tab and the handlers on the page's showConfig. A normal browser click can have no event.data; do not assume it supplies a domain payload, selected row or entire page model. Other producers may send different payloads. Trace their actual emit path and callback signature.
The page handler does not await or catch the handler's returned promise. An asynchronous action must manage its own pending/error/result state and server request semantics. Do not leave a button looking successful merely because its click event was emitted. Use the actual HTTP/API client for the application context, and verify final responses and allowed/denied access.
Stored plugin settings
The project Page editor consumes a version's settings.additionalTabs and settings.settings. The former adds complete tab definitions; the latter adds cards within the owning settings surface. A representative value for the selected version's settings property (not the entire version record) is:
{
"settings": [
{
"type": "fields_list",
"fieldsList": [
{
"name": "heading",
"type": "text",
"label": "Heading",
"column": "custom_settings"
}
]
}
],
"additionalTabs": []
}
Use a dependency selector and its exact binding identifier when configuring a resource reference. A free-text resource ID or storing a value under dependency_list is not equivalent to declaring the plugin dependency. See permissions and dependencies and project resources.
The consuming page and selected version determine where settings appear. Changing a plugin definition does not prove an installed page picked up that version, that old values migrated, or that the runtime consumes the new setting. Verify definition, selected version, installation values and runtime behavior separately.
Visual builder and conversion
The v2 builder uses a graph-like definition with root, cards, elements and optional snippet overrides. Child arrays refer to IDs or supported snippet tokens. It is a different representation from nested v1 tab/card/field arrays.
m1ConvertToM2 defaults to a tab-list root and can accept a card-list root; m2ConvertToM1 uses corresponding options. Converters map supported type/style/layout fields explicitly. They are not a guarantee of lossless conversion of arbitrary JavaScript functions or every undocumented option.
Snippet references are preserved as references rather than universally inlined: v1 snippet nodes map to v2 snippet#<key>:<instanceId> child tokens with separate instance overrides and can be decoded back. Preserve stable identifiers and the snippet store/consumer context. Conversion alone does not validate a referenced snippet exists or authorize its contents.
Before migrating a stored schema, preserve the original, convert a representative copy, inspect fields/layout/dependencies/snippets and reload it through the intended editor and renderer. Test saved output and round-trip meaning. Do not replace a working production schema solely because the converter returned an object.
Verify and troubleshoot
- Confirm the consuming surface, selected plugin version and schema generation.
- Check tab/card/field identifiers and bound value paths using controlled data.
- Verify conditional/permission visibility with the intended ordinary principal.
- Inspect dirty paths and outgoing payload, then reload to prove persistence.
- Exercise validation failure, canceled actions, repeated clicks and partial external-save failure.
- For conversion, compare the saved source and reloaded output, including snippets and false/zero/empty values.
| Symptom | Check |
|---|---|
| Tab/card absent | Nonempty cards, feature/permission checks, condition and correct schema representation |
| Value displays but does not save | Store binding/dirty path, update/create route, transform, backend schema and errors |
| Default zero or false behaves unexpectedly | Exact initializer/type and stored-versus-default truthiness |
| Custom action handler never runs | event_emitter, matching eventName, forwarding component and showConfig handler registration |
| Handler has no domain payload | Producer callback signature; button-group eventData comes from event.data |
| Save partly succeeds | Registered editor/card ordering, separate request outcomes and pending/error handling |
| Plugin setting does not affect runtime | Selected definition/version, installation value and actual runtime consumer |
| Converted layout loses behavior | Supported mapping, IDs, snippet references, callbacks and round-trip output |
Use the linked dedicated references for full card, field and table contracts. Detailed production recovery remains in operator runbooks. The prior consolidated catalog is preserved in repository design history; it is not a current universal renderer specification.