I suggest you stop editing the css files and layout until you get the full fix for the mobile detect. There are 2 issues which 1 was partially fixed in the winchester template by rbarour. Basically, the fix was to include the 2.0 workaround to call the correct css files. However, the code fix did NOT attempt to change ALL instances where specific device files are called. And this is where your issue comes in as the tpl header file is the same one called for mobile, tablet and desktop. But if you look in the common folder, you will see that the 2.1 code has specific headers for each device.
So the same logic has to be implemented, BUT it depends on whether you are using the switches on the templates. If you do NOT use the switches to change views, then you can use this code:
In tpl_main_page.php, find:
PHP Code:
if($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile'){
require($template->get_template_dir('tpl_header_mobile.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header_mobile.php');
} else {
require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');
change to:
PHP Code:
if($detect->isMobile() && !$detect->isTablet() or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile'){
require($template->get_template_dir('tpl_header_mobile.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header_mobile.php');
} else {
require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');
A note on this is that is the tpl_header_tablet is not being called in the code. I don't know whether it was done on purpose by Anne. But if the tpl_header_tablet is suppose to be called for tablets then you can use this code:
PHP Code:
if($detect->isMobile() && !$detect->isTablet() or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile'){
require($template->get_template_dir('tpl_header_mobile.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header_mobile.php');
} else if ($detect->isTablet() or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){
require($template->get_template_dir('tpl_header_tablet.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header_tablet.php');
} else {
require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');
} ?>
If you are using the switches, then follow the posts I wrote in the winchester as you will have to add the session to each if statement. Also, you may have to modify other files if you are using the mobile detect code to call certain files.
Bookmarks