${device} in Freemarker template does not return device data
Written By
Alfonso Crisci
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- When using the Freemarker directive
${device} and checking the resulting content on the interface, no actual device data will be returned:
{brand=unknown, browser=unknown, browserVersion=unknown, model=unknown, os=unknown,
osVersion=unknown, pointingMethod=unknown, qwertyKeyboard=true, screenPhysicalSize={height=-1.0,
width=-1.0}, screenResolution={height=-1.0, width=-1.0}, tablet=false}
Environment
- Liferay DXP 7.0
- Liferay DXP 7.1
- Liferay DXP 7.2
Resolution
- The Device detection capabilities allowing the Freemarker call
${device} to function will work after the installation of the Liferay Mobile Device Detection Lite. The majority of most commercial devices / screen resolutions will be recognized: the plugin includes approximately 200,000 device combinations (device, software, and browser combinations) and 60 properties. Please, remember to set the Template NOT to be cacheable, else the information recorded from the first device used to see the web content will show on other devices as well:

Did this article resolve your issue ?