Include Page |
---|
| _what is a light module |
---|
| _what is a light module |
---|
|
Light module structure
Example of light module structure:
Code Block |
---|
magnolia.resources.dir/
└── <module-name>/
├── apps/
├── dialogs/
│ └── myDialog.yaml
├── module.yaml
├── webresources/
└── templates/
├── components/
│ ├── myComponent.ftl
│ └── myComponent.yaml
└── pages/
├── myPage.ftl
├── myPage.js
└── myPage.yaml
|
Light modules can contain more or fewer folders compared to this example.
Light modules folder: magnolia.resources.dir
Magnolia light modules must reside within the Magnolia resources directory; this directory is also often referred to as the Magnolia light modules folder. The name and the location of this directory are arbitrary, but you must provide the path to the folder via configuration.
Include Page |
---|
| _What is magnolia.resources.dir |
---|
| _What is magnolia.resources.dir |
---|
|
Magnolia 5.6.1+: A change in the light modules folder may also flush the server cache. You can configure this behavior under /modules/cache/config/contentCaching/defaultPageCache/flushPolicy/policies/lightModule/pathToCacheMappings/defaultPageCache
with the pattern
property, which specifies the pattern for the operation. The default value is .*/(templates|webresources|i18n)/.*
.
What items can be defined in a light module?
The following items can be defined within a light module using YAML. Items defined by YAML can be decorated, or can be reused with YAML inherit and include.
Multiexcerpt include |
---|
MultiExcerptName | lightbullet-modulepoint-structurelist |
---|
PageWithExcerpt | _list of definition items with registries which can be done with YAML |
---|
|
Other non YAML-based items which can be in a light module:
- i18n message bundles (see Internationalization and related pages)
- JavaScript Models
Creating a light module with Magnolia CLI
Include Page |
---|
| _Creating a light module with Magnolia CLI |
---|
| _Creating a light module with Magnolia CLIModule structure |
---|
|