Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
HTML Wrap
alignright
classmenu

Related topics:

Include Page
_what is a light module
_what is a light module

Table of Contents

Light module structure

Below you see the structure of an exemplary light module. 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/
            ├── myTemplatemyPage.ftl
            ├── myPage.js
            └── myTemplatemyPage.yaml

Light modules can contain more or less fewer folders compared to this example.

...

Light modules folder: magnolia.resources.dir

...

 

Please note that a Magnolia Light module Magnolia light modules must reside within the so called "magnolia resources directory"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

(warning) 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
MultiExcerptNamebullet-point-list
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:

Creating a light module with Magnolia CLI

Include Page
_Creating a light module with Magnolia CLI
_Creating a light module with Magnolia CLI