WE HAVE A FULLY RESPONSIVE DESIGN WEBSITE. NOW OUR AD COMPANY WANTS TO HAVE ASLIGHTLY DIFFERENT LOOK ON THE MOBILE SITE.
BASICALLY ON A PLACEMENT ON THE LAYOUT.
IS THERE A WAY TO USE CONDITIONALS TO PLACE DIFFERENT AD CODES BASED ON SCREEN SIZE
Ie. More or less
If a regular site show this code, if mobile show this or show nothing at all
or….
Do I have to direct viewers to a mobile template (rather not do that, but….
You can also use img scrset like explained here.. (i have nothing to do with this article.. i picked the first one i founded 😉
https://html.com/attributes/img-srcset/
Other example here..
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_picture
I think you also asked this question in StackExchange, but in case not, an easy / simple way to tell if your site is running on a mobile device rather than a desktop is to you the Mo’Variables add-on which contains a set of early-parsed conditional elements … vis:
Early-parsed Mobile Detection Conditionals
{if is_mobile}
{if is_not_mobile}
{if is_tablet}
{if is_not_tablet}
{if is_phone}
{if is_not_phone}
HTH
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.