Found it. The agent value is different from a mobile to another. So splitting it doesn't work. Therefore I went for this solution below: {% set agent = request.headers['user-agent']|lower|string %} {% set is_mobile = false %} {% if agent is string_containing "mobile" %} {% set is_mobile = true %} {% endif %} Thank you.
Found it. The agent value is different from a mobile to another. So splitting it doesn't work. Therefore I went for this solution below: {% set agent = request.headers['user-agent']|lower|string %} {% set is_mobile = false %} {% if agent is string_containing "mobile" %} {% set is_mobile = true %} {% endif %} Thank you.
Heyy! You can play with the below code in a custom module that you create: {% set agent = request.headers['user-agent']|lower|string %} {% set is_mobile = false %}
YOUR DESKTOP CONTENT GOES HERE...... {% if agent is string_containing "mobile" %} {% set is_mobile = true %}
@prasadcolumbus I recommend either using Smart Content if you need to figure this out server side. Otherwise, you can do this client side fairly easily with either CSS media queries to show/hide specific things on mobile or desktop or use JS Match Media to change interaction of things on mobile/desktop.