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.
<version/>in the dependency.
The default configuration detects mobile devices, splitting them into two groups: smartphones and tablets. You don't need to change anything unless you want to detect other types of devices or other capabilities.
Device detection filter
is registered in the at Configuration >
/server/filters/deviceDetection. The purpose of this filter is to intercept the incoming request and discover the capabilities of the device based on its
All devices identify themselves in the
User-Agent request header. Here is an example what the header looks like when an iPhone 3GS requests the Magnolia International corporate home page. The header basically says "I am an iPhone running iOS 4.0.2 and the Safari browser".
Device capability configuration
The Mobile Detect API provides the capabilities of mobile devices. It knows the specifications of several devices, broken down into groups. The API is built into the Device Detection module so no calls to outside services are needed during detection. Mobile Detect is a clone of Mobile ESP. We use the clone rather than the original because the clone provides a Maven artifact so we do not need to include the API code.
The API is registered in the Configuration app in
The device detection filter asks the API if the requesting device is a smartphone or a tablet device. Once the device capabilities are identified, the filter creates a
DeviceInfo object in the request and sets the following basic properties:
trueif the device is a smartphone.
trueif the device is a tablet.
If you want to implement your own device detection mechanism, look at these Java classes for examples.
$webResourceManager.requireResource("info.magnolia.sys.confluence.artifact-info-plugin:javadoc-resource-macro-resources") DeviceCapabilityinterface and provides information about the capabilities of the device. Gets the
Provides information about the device. All attributes are initially set to defined defaults
Device channel configuration
In order to serve content to the device in an appropriate format, ais resolved next. The
/server/rendering/channelManagement/channels. This resolver resolves the channel to use based on the
The channel is mapped to a variation. The variation consists of templates and a theme that optimizes the content for displaying on the device.