Jump to content

Direct URL to mobile theme?


Recommended Posts

I am trying to do testing on my default mobile theme. I am using a Galaxy Note II. I happened to click the link at the bottom of the mobile theme that says "view full site" and now I can't get the mobile version to load again. I tried closing the browser page on my phone and reloading, but it won't load the mobile version anymore. Why is it doing this and how do I make it go back to the mobile version?

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 1 month later...

add this to header.tpl

<script type='text/javascript' src='mobile detect.js'></script>

<script type="text/javascript">DM_redirect("http://http://ursite.com/index.php?mobile_theme_ok");</script>

 

save it as mobile detect.js and upload

function DM_redirect(MobileURL, Home){

try {

// avoid loops within mobile site

if(document.getElementById("dmRoot") != null)

{

return;

}

var CurrentUrl = location.href

var noredirect = document.location.search;

if (noredirect.indexOf("no_redirect=true") < 0){

if ((navigator.userAgent.match(/(iPhone|iPod|BlackBerry|Android.*Mobile|BB10.*Mobile|webOS|Windows CE|IEMobile|Opera Mini|Opera Mobi|HTC|LG-|LGE|SAMSUNG|Samsung|SEC-SGH|Symbian|Nokia|PlayStation|PLAYSTATION|Nintendo DSi)/i)) ) {

 

if(Home){

location.replace(MobileURL);

}

else

{

location.replace(MobileURL + "?url=" + encodeURIComponent(CurrentUrl));

}

}

}

}

catch(err){}

}

Link to comment
Share on other sites

  • 11 months later...

I am trying to do testing on my default mobile theme. I am using a Galaxy Note II. I happened to click the link at the bottom of the mobile theme that says "view full site" and now I can't get the mobile version to load again. I tried closing the browser page on my phone and reloading, but it won't load the mobile version anymore. Why is it doing this and how do I make it go back to the mobile version?

Hi did u figure it out? Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...