Organize CMS configuration
CMS definitions live under cms/ in the Symfony project directory. If the application is inside an app/ directory, its definitions are under app/cms/; the directory name is relative to kernel.project_dir.
Directory structure
cms/
├── blocks/
├── contents/
├── layouts/
├── menus/
├── modules/
└── sites/
Each element has an identifier directory containing config.yaml and any required Twig templates or translations. For a hero module:
cms/modules/hero/
├── config.yaml
├── render.html.twig
└── translations/
└── sfs_cms_modules.en.yaml
Add edit.html.twig and form.html.twig when the module needs a custom editor preview or field layout. They are not mandatory for every dynamic module.
See the configuration guides for sites, content types, layouts, modules, blocks, and menus.
Override a supplied definition
CMS collections are loaded in this order:
- The bundle's built-in collection.
- Configured external collections.
- The project's
cms/directory.
Later definitions with the same identifier override earlier settings according to their configuration schema. Some lists, including site hosts and paths, replace the earlier list rather than appending to it.
For example, cms/sites/default/config.yaml customizes the supplied default site. A directory with a different identifier creates another site instead.
Twig namespaces follow the same collection precedence, so a project can override a supplied template without editing files in vendor/.
Apply changes
Clear the application cache after changing definitions:
php bin/console cache:clear
Open the affected admin screen, create or edit a record, and preview its output. When changing stored data formats, provide the relevant migration instead of relying on a revision number alone. Recompile and review published content after changing render templates.
Fixtures and data import are separate from element definitions. Use the application's documented fixture workflow; the core package does not automatically create a demo website when a configuration directory is added.