Welcome guest, please Login or Register

EEC.MS - ExpressionEngine add-ons

You are here: HomeForum Home → Free add-ons → Plugins → Thread

   

MX Mobile Device Detect Allowing users to go view full site after being redirected?

Rank

Total Posts: 1

Joined 2010-07-28

PM

First off, I think this plugin is great. This is the second time I have used it. I like that the plugin automatically detects mobile users and then redirects them to my mobile site. I would like the ability to have the user be able to view the full site after being redirected. The problem with this is that the plugin just keeps redirecting the user to the mobile site. Is there anyway to allow the user to view the full site if they wish?

     
Avatar
RankRankRankRank

Total Posts: 701

Joined 2010-07-13

PM

I have a couple ideas for this - which v. do you interested - ee1 or ee2?

     
Rank

Total Posts: 1

Joined 2010-07-28

PM

ee2

     
Avatar
Rank

Total Posts: 12

Joined 2010-07-21

PM

Another vote for an EE2 version of this request.

     
Avatar
RankRankRankRank

Total Posts: 701

Joined 2010-07-13

PM

New version released.

     
Avatar
RankRankRankRank

Total Posts: 701

Joined 2010-07-13

PM

dapacreative could you please give your feedback after test? Thanks!

     
Rank

Total Posts: 3

Joined 2010-12-14

PM

Hi Max,
Firstly great plugin. I love when these “just work” and the code is clearly set out for us.

With regard to this original question, I understand its now possible to redirect mobile devices but to also allow them to view the full version.
Is it too much to ask for an example of the best approach?

The logic I’d like to put it in the homepage template

{exp:mobile_detect}
 {if mobile}
 {exp
:mobile_detect location="http://m.site.com/"
 {
/if}
{
/exp:mobile_detect} 

I have a feeling the link I have on the mobile site to the full site needs to go to a separate template that contains just this line
{exp:mobile_detect enable=“off” location=“http://site.com/”} so that it can create the cookie.

But this seems clumsy surely I can add something to the “view full site” link like “http://site.com/?fullsite” then update the code to something like

{exp:mobile_detect}
 {if 
"?fullsite"}
  {exp
:mobile_detect enable="off" location="http://site.com/"
 {
/if}
 {if mobile}
 {exp
:mobile_detect location="http://m.site.com/"
 {
/if}
{
/exp:mobile_detect} 

 

     
Rank

Total Posts: 3

Joined 2010-12-14

PM

I’ve had a crack at embedding this logic completely within the homepage.
It’s not perfect, the link from the mobile site back to view the fullsite homepage template is http://website.com.au/?fullsite=1

My issue is the redirect within the “if mobile” statement is being ignored?
Am I handling this correctly

{preload_replace:fullsite="<?php if(isset($_GET['fullsite'])) { $var = $_GET['fullsite']; } else { $var = 'null'; } if($var == '') {echo 'null';} else {echo $var;} ?>"
{if {fullsite} 
0}
 {exp
:mobile_detect enable="off"  location="http://website.com.au/"}
{if
:else}
 {exp
:mobile_detect}
 {if mobile}  
  This redirect is being ignored
  {exp
:mobile_detect enable="on" location="http://website.com.au/m"}
 {
/if}
 {
/exp:mobile_detect} 
{
/if} 
     
Avatar
RankRankRankRank

Total Posts: 701

Joined 2010-07-13

PM

1. did you test you php?

2.is it possible to used segment_x logic in your templates?
like http://website.com.au/fullsite

{if segment_1 "fullsite"}
{exp
:mobile_detect enable=“off”  location=“http://website.com.au/”}
{if:else}
{exp
:mobile_detect}
{if mobile} 
  This redirect is being ignored
  {exp
:mobile_detect enable=“on” location=“http://website.com.au/m”}
{/if}
{
/exp:mobile_detect}
{
/if} 
     
Rank

Total Posts: 3

Joined 2010-12-14

PM

Yes the PHP is correct for http://website.com.au/?fullsite=1 {fullsite} shows the value 1
I feel like the nested {exp:mobile_detect} tags are the issue, one is the IF statement and the other is the redirect. The redirect is being ignored

{exp:mobile_detect}
{if mobile} 
  This redirect is being ignored
  {exp
:mobile_detect enable=“on” location=“http://website.com.au/m”}
{/if} 
     
Avatar
RankRankRankRank

Total Posts: 701

Joined 2010-07-13

PM

1. PHP Parsing Stage - input?

2. parse=“inward” ?

{exp:mobile_detect parse="inward"}

{exp
:mobile_detect}
{if mobile}
  This redirect is being ignored
  {exp
:mobile_detect enable=“on” location=“http://website.com.au/m”}
{if:else}
not mobile
{
/if}

{exp
:mobile_detect} 

 

     
Rank

Total Posts: 3

Joined 2011-02-18

PM

Max:

I appreciate your work on this plugin, and thanks in advance for your patience with my question smile.
On this project I’m running EE1.

I install the plugin and point to the location of my mobile template using this tag (placed at the top of the full site template):

{exp:mobile_detect location="http://www.mysite.com/mobile"

This takes the mobile user to my mobile template, where I have some basic contact info and then a link to the full site.

My question: How do I use the other tags—listed below—to prevent this from becoming a loop if the mobile user decides to view the full website?

{exp:mobile_detect location="http://site.com/" redirect="not_mobile"

and

{exp:mobile_detect}
 {if mobile}
 Is mobile device
 {
/if}
 {if not_mobile}
 Is not mobile device
 {
/if}
{
/exp:mobile_detect} 

Can you provide an example of how these tags would be used in the full site template and the mobile one?

Thanks

     
Avatar
RankRankRankRank

Total Posts: 701

Joined 2010-07-13

PM

I’m sorry but other tags is not available for EE1 version.

     
Rank

Total Posts: 3

Joined 2011-02-18

PM

Thanks for the reply. I plan to use this on EE2 sites as well. Could you possibly explain how that would work on EE2?

Thanks.

     
Avatar
RankRankRankRank

Total Posts: 701

Joined 2010-07-13

PM

need to used parameter enable=“off” for this.
Example of using:

{if segment_1 "fullsite"}
{exp
:mobile_detect enable=“off”  location=“http://website.com.au/”}
{if:else}
{exp
:mobile_detect}
{if mobile} 
  This redirect is being ignored
  {exp
:mobile_detect enable=“on” location=“http://website.com.au/m”}
{/if}
{
/exp:mobile_detect}
{
/if} 
     
Rank

Total Posts: 3

Joined 2011-02-18

PM

Thanks.