Module and layout resources
resource_module
Section titled “resource_module”| Resource key | Default / behavior |
|---|---|
identifier | Required nonempty module identifier. |
id | Computed, immutable. |
type | module; mutable in this code line (changes the module class). |
icon | question |
title | Empty string; a field reference is checked when supplied. |
parent | Legacy parent module setting. |
importable | false; enables the import UI. |
print_view, print_view_options | View entity and map of print options. |
buttons | Map of default module button overrides. |
position | Keeps current position unless set. |
owner_field | Field used as owner. |
description | Module description. |
options | Free map; keys are interpreted by module class, capabilities and SPA. |
fields | List of field definitions, default []. |
layouts | Map keyed by layout type. |
Registered module classes: module, clients, files, permissions, policies, roles, users, views, configs, translations. See modules and field reference. Changing type is technically supported but can change base fields and behavior; inspect the plan before applying.
[{"resource_module":"notes","resource":{"identifier":"notes","type":"module","title":"name","importable":true,"description":"Notes","fields":[{"identifier":"name","type":"text","options":{"rules":"required"}}],"layouts":{"detail":"/modules/notes/notes.detail"}}}]Layouts
Section titled “Layouts”The example requires modules/notes/notes.detail.yaml or .json inside the system directory. Give the path without extension; YAML takes precedence over JSON. The loader resolves expressions inside the file and wraps its content as spec.
Do not put ${file(...)} or ${jsonFile(...)} directly in resource.layouts: authoring validation rejects these expressions. A missing path is interpreted as a JSON string and then fails if it is not valid JSON. A literal JSON string is accepted by the loader, but a file reference is easier to maintain.
A structured value must have the schema wrapper {"spec": { ... }} (optional identifier, type, computed id); a raw {"tabs": ...} object does not fill spec.
For example, the referenced JSON file can contain:
{"tabs":[{"identifier":"main","rows":[{"cols":[{"components":[{"type":"field_group","options":{"fields":["name"]}}]}]}]}]}resource_layout
Section titled “resource_layout”Standalone layouts require identifier; type defaults to detail, spec is a map and id is computed/immutable. Associate the layout through the consuming layout identifier or module layout configuration.
[{"resource_layout":"notes_panel","resource":{"identifier":"notes.panel","type":"detail","spec":{"tabs":[]}}}]See layout structure and components.
Source: BakeryResourceModule::buildSchema, validateConfiguredLayouts, getLayouts; BakeryResourceLayout::buildSchema; Modules/Module.php class registry.