Magnolia 5.7 reached extended end of life on May 31, 2022. Support for this branch is limited, see End-of-life policy. Please note that to cover the extra maintenance effort, this EEoL period is a paid extension in the life of the branch. Customers who opt for the extended maintenance will need a new license key to run future versions of Magnolia 5.7. If you have any questions or to subscribe to the extended maintenance, please get in touch with your local contact at Magnolia.
This page explains how to create and use a light module. The light module will host the files for the templates and other things.
Create a module folder
Create the following folder structure on your computer:
$myDir/ └── my-first-website-tutorial └── one-pager-module ├── dialogs │ ├── components │ └── pages ├── includes ├── templates │ ├── components │ └── pages └── webresources
$myDir can be anywhere but it must be a real directory such as:
- Mac OS X
We recommend that you create the files and folders by hand. You can download the
one-pager-module and its complete contents for reference. But be aware you get the final state of the files, like at end of the tutorial.
üor special characters such as slashes
\and so on. The name must match the regular expression
Create a light module with the Magnolia CLI
create-light-module. Open a shell,
cdto your light modules directory, and execute the following command:
mgnl create-light-module one-pager-module
üor special characters (e.g. slashes
\and so on). The name must match the regular expression
Note that this only works if you have installed Magnolia CLI, see Magnolia CLI Installation.
magnolia.resources.diris a property defining the directory from which resources are loaded in a Magnolia instance. This directory is used for file-based resources such as light modules and for overriding classpath resources. The property is configured in
WEB-INF/config/default/magnolia.propertiesand has the default value
$magnolia.home/modules. To see the current value of the property, go to the Config Info tab in the About Magnolia app.
You can use symbolic links (a.k.a symlinks or soft links) in the resources directory to include light modules located elsewhere on your system.
If you installed Magnolia using Magnolia CLI, the default for the
magnolia.resources.dir is the
light-modules directory created where you executed the
jumpstart command. This assumes you did not use the
-p option to specify another location for the
To change the directory from which resources are loaded:
Stop Magnolia. Go to the
magnolia-x.y/apache-tomcat-x.y/bindirectory and type:Mac OS X, Linux, Solaris
magnolia-x.y/apache-tomcat-x.y/webapps/magnoliaAuthor/WEB-INF/config/default/magnolia.propertiesfile and set the
<$myDir>with the actual path to your module folder.magnolia.properties
Example on Windows. Note forward slashes!magnolia.properties
Save the file.
Start Magnolia:Mac OS X, Linux, Solaris
Next: Creating a page template