Jump to content
TNG Community
tngrlkrz

Mobile and Standard Site Views

Recommended Posts

tngrlkrz

TNG offers mobile users a 'switch' button at the bottom of each page (before the footer) to switch between standard and  mobile views.  I added Ken Roy's very useful Mobile Site Enhancement Mod to improve the mobile view appearance.  It looked so good that i thought on occasion it would be nice to have that view available on the PC as well.  However, I couldn't find a way to have that happen short of having a link which appends the '?sitever="mobile", and the the switch back to 'standard' appears, but the the switch again to 'mobile' button does not.

So, I put the following code into my private Mod but wanted to share it anyone else finds it useful. The code is the same used to set mobile devices back to mobile from standard. Maybe there's another way or better code set the 'site' to mobile, but this works fine for me on all pages, and still works fine on mobile phones as well.  I think maybe Darrin could add this code so the option is available on all devices.

// modify genlib.php -- give ability to switch to mobile on  a laptop

%target:genlib.php%
%location:%
    include($cms['tngpath'] . "stdsitecredit.php");
%end:%

%insert:before%
   else {            
      $thispage = getScriptName(false);
        $thispage = preg_replace('/\??\&?sitever=(mobile|standard|tablet)/',"",$thispage);
        $con = strpos($thispage, "?") == false ? "?" : "&";        
      $gotover = "mobile";
        $message = $text['switchm'];
      $footer .= "<p class=\"smaller center\">\n";
        $footer .= "<a href=\"$thispage{$con}sitever=$gotover\" class=\"fieldnameback lightlink2 rounded4\">&nbsp;{$message}&nbsp;</a>\n";
        $footer .= "</p><br/>\n"; 
         }  
%end:%

Ron 

TNG 11.0.2   http://www.kmtrees.com wampserver 2.5,legacy 7.5,  family historian 6.2.2, win 10 pro

Share this post


Link to post
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

×