4

We have a Java web app using DXA 1.7 and SDL Web 8.5 out of the box (using my own models and views), we are having trouble using contextual expressions from the tag library and the evaluated value of device.mobile.

Without the use of smart target, what else needs to be configured in order to use contextual expressions and detect mobile devices?

We have noticed that the device.mobile / device.tablet variables are never being set to true (keep using default false value) in the ClaimStore when testing on respective devices. Other expressions such as device.displayWidth and height are being updated and rendered.

JSP markup used:

<div class="row ">
  <div><context:eval expression="'Hello ' + browser.version" /></div>
</div>

Result:

<div class="row ">
  <div></div>
</div>

Do our test devices need to be added to a database for this to work? If so, is there any updated documentation after this: https://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v7/GUID-2AA5A172-654C-433C-B306-FF36B9E1A820

Failed ReferenceThe application was unable to locate content which was referenced here. This content may be important. You should contact your system administrator as soon as possible to resolve this issue.

Our intent is to render mobile specific content with the logic embedded within a JSP. Thanks.

  • 1
    I think the documentation is just pointing to the SDL Web 8.5 installation guide, which talks about installing/setting up the context service (docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v5/…). Could you provide your configuration files you are using on your dxa setup, and also in the context service ? – Harald Hoffelinck Nov 30 '17 at 8:36
  • What Harald mentions is correct, the last line in the topic should read: "The Context Expression module is installed. For information on how to create device database, refer to the SDL Web product documentation.", it will be fixed soon (by the way, you can add a comment in the documentation when you see such failed references) – Bart Koopman Nov 30 '17 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.