-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Allow passing config.root.modelElement etc. in the configuration to define the model root #20029
Copy link
Copy link
Open
Enhancement
Copy link
Labels
squad:coreIssue to be handled by the Core team.Issue to be handled by the Core team.type:taskThis issue reports a chore (non-production change) and other types of "todos".This issue reports a chore (non-production change) and other types of "todos".
Description
Describe the task
Currently the model root element name is always $root — it is hardcoded throughout the engine and cannot be changed by the integrator. This task introduces a config.root.modelElement option (and potentially other config.root.* options) that allows configuring the root element name used when the editor is initialized.
This is a prerequisite for editors that need a custom root schema — for example, a root that restricts or extends what content is allowed at the top level differently from the default $root. It is also the foundation that makes #20026 meaningful: fixing hardcoded $root checks is only useful once the root name can actually differ.
Definition of Done
-
config.root.modelElementis accepted — the editor reads this option during initialization and uses it as the model root element name instead of$root. - Editor constructor uses the configured root name — the editor constructor reads
config.root.modelElementand passes it when creating the model root, instead of hardcoding'$root'.- This one applies to all editors (classic, …).
- Backward compatible — omitting
config.root.modelElementresults in identical behavior to today ($rootis used). - Documented — the new config option is described in the API docs with a usage example.
- Automated tests cover initialization with a custom root name, schema registration, and data round-trip.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
squad:coreIssue to be handled by the Core team.Issue to be handled by the Core team.type:taskThis issue reports a chore (non-production change) and other types of "todos".This issue reports a chore (non-production change) and other types of "todos".