Forums / Addon Templates / goMobile Support Thread

goMobile Support Thread

Started by steveyork136 on 20 Jul 2011, 8:04 PM · Views: 22,078

Results 21 to 30 of 30
4 Oct 2012, 11:03 AM
#21
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

goMobile Support Thread

I haven't tested the new version of this mod but it looks like there may be a problem switching between mobile and full sites.
The new sitechoice.php looks for a querystring variable called 'fullsite', but the code looking for a querystring variable called 'fullsiteoverride' is still in init_templates.php.
It looks to me like the init_templates.php included in the new distribution is an old one. I think it should just look for a cookie called 'siteversion' and show the appropriate template based on that rather than looking at querystring variables.
As I mentioned, I haven't tested this yet so I could be wrong!

4 Oct 2012, 4:09 PM
#22
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

Re: goMobile Support Thread

Change this section of code in includes/init_includes/overrides/init_templates.php

/*** Check if user has requested specific version of the site*/

if ($_GET['fullsiteoverride'] == 1) 
   {
	$value = 'fullsiteoverride';
	setcookie("mobileCookie", $value);
	setcookie("mobileCookie", $value, time()+1800); /* expire in 1/2 hour */ 
	$iwnatfullsite = 1;
	}
	
if ($_GET['fullsiteoverride'] == 0) 
   {
	$value = 'fullsiteoverride';
	setcookie("mobileCookie", $value);
	setcookie("mobileCookie", $value, time()-1800); /* expire in 1/2 hour */ 
	$iwnatfullsite = 0;

	}	

if(isset($_COOKIE['mobileCookie'])) {$iwnatfullsite = 1; }


/*** Check if there is a specific template for this mobile platform and use it*/
if ($mobile_browser >= 1){
		if($iwnatfullsite == 1)
			{ 
		 		$template_dir;
			 }
		 else
			 {
				$template_dir = $template_dir.'_mobile';
			}
}
/*** EOF : SPECIFIC TEMPLATE FOR MOBILE CLIENT**/  

to this

/* Override to mobile version of site if requested */
if(($mobile_browser >= 1 && !isset($_COOKIE['siteversion'])) || isset($_COOKIE['siteversion']) && $_COOKIE['siteversion'] == 'mobile') $template_dir = $template_dir . '_mobile';

/*** EOF : SPECIFIC TEMPLATE FOR MOBILE CLIENT**/  
12 Oct 2012, 6:43 PM
#23
mshutch avatar

mshutch

New Zenner

Join Date:
Feb 2007
Location:
Ontario, Canada
Posts:
34
Plugin Contributions:
0

Re: goMobile Support Thread

Thank you for your input Damian! I had narrowed it down to the same thing, but wasn't sure how to make the change so that it would work. I'll give it a try this weekend!

--Colleen

13 Jun 2013, 2:44 AM
#25
wirefram avatar

wirefram

New Zenner

Join Date:
Apr 2011
Posts:
95
Plugin Contributions:
0

Re: goMobile Support Thread

Hello

Is there a way to get the templates files for this mod or something to give an example how to make mobile templates/CSS files?

beside read.me telling to create another template folder the add-on comes with no explanation ....

Thanks

L.
:blush:

**2nd market domain names for sale **
dot com only !
http://www.ventesites.com

26 Jul 2013, 1:38 PM
#26
hitch avatar

hitch

New Zenner

Join Date:
Sep 2006
Posts:
75
Plugin Contributions:
0

Re: goMobile Support Thread

Hello,

This module works great for me on 1.5.1 however when i go to the mobile site it drops all the sidebox's, I'm guessing because they aren't activated in the boxes layout controller in admin (all files were duplicated). I'd quite like them. how have others worked around this? Cheers!

:-)

26 Jul 2013, 2:09 PM
#27
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,779
Plugin Contributions:
2

Re: goMobile Support Thread

hitch:

Hello,

This module works great for me on 1.5.1 however when i go to the mobile site it drops all the sidebox's, I'm guessing because they aren't activated in the boxes layout controller in admin (all files were duplicated). I'd quite like them. how have others worked around this? Cheers!

:-)

That's the whole idea, it lightens the content to suit a smaller screen.
Can you post a link to your site?

6 Mar 2015, 3:32 PM
#28
karinvd avatar

karinvd

New Zenner

Join Date:
Nov 2012
Location:
Utrecht, Nederland
Posts:
43
Plugin Contributions:
0

Re: goMobile Support Thread

damiantaylor:

Change this section of code in includes/init_includes/overrides/init_templates.php

/*** Check if user has requested specific version of the site*/

if ($_GET['fullsiteoverride'] == 1)
{
$value = 'fullsiteoverride';
setcookie("mobileCookie", $value);
setcookie("mobileCookie", $value, time()+1800); /* expire in 1/2 hour */
$iwnatfullsite = 1;
}

if ($_GET['fullsiteoverride'] == 0)
{
$value = 'fullsiteoverride';
setcookie("mobileCookie", $value);
setcookie("mobileCookie", $value, time()-1800); /* expire in 1/2 hour */
$iwnatfullsite = 0;

}	

if(isset($_COOKIE['mobileCookie'])) {$iwnatfullsite = 1; }

/*** Check if there is a specific template for this mobile platform and use it*/
if ($mobile_browser >= 1){
if($iwnatfullsite == 1)
{
$template_dir;
}
else
{
$template_dir = $template_dir.'_mobile';
}
}
/*** EOF : SPECIFIC TEMPLATE FOR MOBILE CLIENT**/

> 
> to this
> ```
/* Override to mobile version of site if requested */
if(($mobile_browser >= 1 && !isset($_COOKIE['siteversion'])) || isset($_COOKIE['siteversion']) && $_COOKIE['siteversion'] == 'mobile') $template_dir = $template_dir . '_mobile';

/*** EOF : SPECIFIC TEMPLATE FOR MOBILE CLIENT**/  

This was exactly wher i was looking for, thx for youre time and efforts :-)

21 May 2015, 5:50 PM
#29
mikey_d avatar

mikey_d

New Zenner

Join Date:
Jan 2012
Location:
Canada
Posts:
16
Plugin Contributions:
0

Re: goMobile Support Thread

I'm running 1.5.1 and the module works fine, except for EZ pages. They load the header and nothing else. I have the URI Mapping add on, but disabling it didn't fix my problem. I looked at my other addons and none of them should affect how EZ pages load. Anyone else have a similar issue?

26 Aug 2015, 10:56 AM
#30
mcqueeneycoins avatar

mcqueeneycoins

Zen Follower

Join Date:
Jan 2008
Posts:
156
Plugin Contributions:
0

Re: goMobile Support Thread

This mod is exactly what I've been looking for to combine a dynamic site with responsive templates using the DIY responsive template mod. Here's what I'm trying to resolve now: I have 2 versions of templates I'm working with--the main version we've used for years, and a new one I'm building. The existing template is not mobile-optimized and I plan to replace it with the new version eventually. What my template folder looks like now is template #1, template #2, template #2_mobile. However, even when I have template #1 selected, when attempting to access the site on a mobile device it goes to template #2_mobile.

Is there a way to change the code to look for a mobile version of the current template, and finding none default to the full site instead of going to another version that does have a mobile folder?