Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Pegasus83 Posted August 7, 2015 Posted August 7, 2015 Hi guys,I updated this night from 3.4.8 to 4.0.12. In the old Forum I had a mobile skin with a different analytics code from the desktop one.How could I set the new (and single) skin to load different scripts if the user is on desktop or mobile (phone and tablet)?I tried with <code><div class="ipsClearfix ipsResponsive_showDesktop ipsResponsive_hideTablet ipsResponsive_hidePhone"></code>But it does not workThanks!
Lukeroge Posted August 7, 2015 Posted August 7, 2015 Can't you just filter the end results? Using two different codes seems a bit silly.
Pegasus83 Posted August 7, 2015 Author Posted August 7, 2015 Can't you just filter the end results? Using two different codes seems a bit silly.Yes, I could, but I need it for my stats. A solution could be useful also for other aims.I think it's related to a "if" statement, but I don't know how 4.0 manages these codes.
Jim M Posted August 7, 2015 Posted August 7, 2015 Unfortunately, as it is javascript you cannot use CSS classes to hide it as it will execute no matter what. You could use some jQuery or Javascript to detect if the window width is below 1024px (that would mean it's a tablet or mobile device) then use a variable to change out your Google analytics property ID accordingly.
Pegasus83 Posted August 7, 2015 Author Posted August 7, 2015 Unfortunately, as it is javascript you cannot use CSS classes to hide it as it will execute no matter what. You could use some jQuery or Javascript to detect if the window width is below 1024px (that would mean it's a tablet or mobile device) then use a variable to change out your Google analytics property ID accordingly. {{if in_array('ipsLayout_minimal', \IPS\Output::i()->bodyClasses )}}can't this help me?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.