Module Configuration (cms/modules)
Each module is configured in:
cms/modules/<module_name>/config.yaml
The schema is defined in cms-bundle/src/Config/Model/Module.php.
Minimal Example
module:
revision: 1
Only revision is required. Other keys are optional and have defaults.
Practical Example
module:
revision: 1
enabled: true
group: 'content'
render_template: '@module/hero/render.html.twig'
edit_template: '@module/hero/edit.html.twig'
form_template: '@module/hero/form.html.twig'
compatible_contents: ['page', 'article']
module_type: 'Softspring\CmsBundle\Form\Module\DynamicFormModuleType'
module_options:
label_format: 'modules.hero.%%name%%.label'
form_fields:
title:
type: translation
subtitle:
type: text
Option Reference
Top-level module keys:
revision(required, integer)enabled(optional, boolean, default:true)group(optional, string, default:default)render_template(optional, default:@module/<module_name>/render.html.twig)edit_template(optional)form_template(optional)compatible_contents(optional, array of content type ids)module_type(optional, default:Softspring\CmsBundle\Form\Module\DynamicFormModuleType)module_options(optional, free-form map passed to the module type)
What To Configure First
- Set
revisionfor every module. - Set at least
render_templatewhen you do not follow the default path. - Use
groupto keep the module picker organized in admin. - Use
compatible_contentswhen a module should only appear in certain content types. - Use
module_optionsaccording to themodule_typeyou chose (keys depend on that type).
Notes
module_optionshas no fixed schema at this level; each module type defines what it expects.- If
enabledisfalse, the module exists in config but is not available for usage. - Increase
revisionwhen module data structure or behavior changes.