Magnolia 4.5 reached end of life on June 30, 2016. This branch is no longer supported, see End-of-life policy.
In the STK resources are referenced in the Theme configuration. Resources can also be added at a and level.
It is not necessary to store resources in the
resources workspace. You can link to any valid internal or external URL.
See Themes for more information about how resources are used in the STK.
The following resource types can be created in Resources:
To create a new resource item:
Depending on the resource type selection, Edit Item opens one of three dialogs:
In the Advanced tab:
By default, the classpath of a Magnolia webapp contains the JAR files in
/WEB-INF/lib and any classes and resources in
/WEB-INF/classes. The advantage of storing resources in the module itself is that the resources become part of the software lifecycle and follow the same release process as the code. As these resources are not editable in AdminCentral, this approach works best for items such as background graphics and logos. For example, the icons used in the AdminCentral are stored inside the AdminCentral module jar. See:
The path for files served from classpath is
http://<domain>/<contextPath>/.resources/<path to file>. The URI mapping configuration that resolves resources from a location that starts with
/.resources (note the dot) is in Configuration >
The dot naming convention for this resources in classpath was chosen to avoid confusion with file location names assigned by developers. This is a convention that is used in other file locations too such as
For loading bypassed and non-processed resources you can add custom resource loaders that implement the
info.magnolia.module.resources.loaders.ResourceLoader interface. The
FileSystemResourceLoader is an example of such a loader. It allows you to load resources from a custom file system path. You can define one path in the loader's configuration. The order of the loaders can be changed by moving the loader node up or down the tree.
You can make resources visible and editable via AdminCentral by storing them in the
resources workspace is
http://<domain>/<contextPath>/resources/<path to file>. For example:
The URI mapping configuration that resolves resources from a location that starts with
/resources (note the absence of the dot) is in Configuration >
/server/URI2RepositoryMapping/mappings/resources. Note that if a resource is marked as bypassed in the workspace, the system looks for the resource in the classpath.