I need to change the rendering of a page depending if it is a desktop client or a mobile device. Is there any way to get the user agent in a page controller so I set a flag and use it in the template.
Asked
Active
Viewed 22 times
1 Answers
3
If you wish to use this approach and control the template use yourself you would use the controller to look at
def agent = request.getHeader("User-Agent")

Russ Danner
- 693
- 3
- 11