Magnolia 5.6 reached end of life on June 25, 2020. This branch is no longer supported, see End-of-life policy.
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 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:
/Users/johndoe/magnolia
C:\Users\johndoe\magnolia
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 [a-zA-Z0-9-_]
.create-light-module
. Open a shell, cd
to 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 [a-zA-Z0-9-_]
.Note that this only works if you have installed Magnolia CLI, see Magnolia CLI Installation.
magnolia.resources.dir
property magnolia.resources.dir
is 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.properties
and 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. 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 light-modules
folder.
To change the directory from which resources are loaded:
Stop Magnolia. Go to the magnolia-x.y/apache-tomcat-x.y/bin
directory and type:
./magnolia_control.sh stop
./magnolia_control.bat stop
Edit the magnolia-x.y/apache-tomcat-x.y/webapps/magnoliaAuthor/WEB-INF/config/default/magnolia.properties
file and set the magnolia.resources.dir
property. Replace <$myDir>
with the actual path to your module folder.
magnolia.resources.dir=<$myDir>/my-first-website-tutorial/light-modules
Example on Windows. Note forward slashes!
magnolia.resources.dir=C:/Users/johndoe/magnolia/my-first-website-tutorial/light-modules
Save the file.
Start Magnolia:
./magnolia_control.sh start
./magnolia_control.bat start
Next: Creating a page template