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 / bug tracker / future requests

Avatar
RankRankRankRank

Total Posts: 701

Joined 2010-07-13

PM

MX Mobile Detect is a small and simple plugin to detect if the template was requested by Mobile Device or not…

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

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

New tags (v. 2.3.0):
You can also to turned off plugin action with this

{exp:mobile_detect enable="off"  location="http://site.com/"

turned on mobile redirect

{exp:mobile_detect enable="on"  location="http://site.com/"

New parameter (v. 2.4.0):

client (optional) - the string which you want to find in HTTP_USER_AGENT. It could be the OS name/version, Browser name etc.. For example you can redirect all users with Internet Explorer 6.0 to specific page.

{exp:mobile_detect location="http://site.com/please-update-your-ie.html" client="MSIE 6."

NOTE: this option is overwriting the mobile detect functionality.

Download & Documentation

     
Rank

Total Posts: 1

Joined 2010-08-03

PM

Hi Max,

This is a great plugin!

FYI, in version 2.3.0 it wasn’t recognizing the iPad as a mobile device (using the emulator and also as the user-agent in Safari 5.0.1). In the pi.mobile_detect.php file I changed

iPad 
to
ipad 

on line 158 and the iPad was successfully detected as a mobile device.

     
Avatar
RankRankRankRank

Total Posts: 701

Joined 2010-07-13

PM

Thanks Chad - the package was updated.

     
Rank

Total Posts: 1

Joined 2010-09-13

PM

Max,

I like the plugin. I actually updated your plugin code for my purposes with what I feel is a very useful addition. I added a couple of parameters, “cookie_name” and “cookie_value”. This allows me to set a cookie on the mobile site to notify your plugin that the mobile visitor should be allowed to view the full site. This is a much more elegant solution in my opinion then having code in the template to set the enable paramter to on/off. Just thought I’d mention it since it’s such an easy feature to implement.

Thanks again for the plugin.

Luther

     
Rank

Total Posts: 2

Joined 2010-11-24

PM

Hi Max,

Thanks for a really useful plugin.

Maybe I’m doing this wrong, but I’m trying to target content to iPad/iPhone alone and I’m having difficulty getting the “client” to work:

{exp:mobile_detect client="iPad|iPhone"}
<p>This is iPad/iPhone content</p>
{/exp:mobile_detect} 

It would be cool if I could use an {else} statement in there too..

Thanks

     
Avatar
RankRankRankRank

Total Posts: 701

Joined 2010-07-13

PM

Hello Neo,
yes, the problem is that client parameter doesn’t support the multitags (with |). But it is a good ides, so give me a day to add these options (| and {if}) to the plugin.

     
Rank

Total Posts: 2

Joined 2010-11-24

PM

Thanks Max - I’m looking forward to the update.

     
Rank

Total Posts: 3

Joined 2011-01-04

PM

Luther - 13 September 2010 10:40 PM

Max,

I like the plugin. I actually updated your plugin code for my purposes with what I feel is a very useful addition. I added a couple of parameters, “cookie_name” and “cookie_value”. This allows me to set a cookie on the mobile site to notify your plugin that the mobile visitor should be allowed to view the full site. This is a much more elegant solution in my opinion then having code in the template to set the enable paramter to on/off. Just thought I’d mention it since it’s such an easy feature to implement.

Thanks again for the plugin.

Luther

I like this idea.  Any thoughts in integrating this bit to the main code base?

     
Avatar
RankRankRankRank

Total Posts: 701

Joined 2010-07-13

PM

Well, 2 voices for this.So as I understand the idea is to have possibility to check cookies which was setup by another add-on?  I will do it.

     
Rank

Total Posts: 22

Joined 2010-09-22

PM

Also recommend adding “webos”, “palmos” to $_mobileClients in pi.mobile_detect. (all palm systems like palm pre).

     
Rank

Total Posts: 1

Joined 2011-04-15

PM

Why does the plugin break when I take out ipad out from $_mobileClients? The plugin works great, except that I want iPad users to be taken to my normal site, not the mobile version.

Suggestions for a newbie?

     
Rank

Total Posts: 2

Joined 2011-04-27

PM

hello, thank you for your plugin.

i have a newbie question, i placed the code so when someone goes to mysite.com/land, they are redirected to mysite.com/m/land.

however, when the link is dynamic mysite.com/land/abc, the user is still redirected to mysite.com/m/land.

how can it go to mysite.com/m/land/abc ??

thanks in advance!

     
Rank

Total Posts: 22

Joined 2010-09-22

PM

+ 1.

I wanted same thing & (essentially) ended up just placing the script on each page to get it to work.

     
Avatar
RankRankRankRank

Total Posts: 701

Joined 2010-07-13

PM

Well, the most important question is how to create flexible method for setup this url.
You can try version in attachment and give me your feedback.

{exp:mobile_detect location="http://mysite.com/m/{uri}"
     

File Attachments

Rank

Total Posts: 2

Joined 2011-04-27

PM

thanks for your reply! the plugin now works the way i need, i appreciate you updating it, great work!

     
Rank

Total Posts: 2

Joined 2011-07-04

PM

Hi there.

Just reporting a possible bug in MX Mobile Device Detect v2.8.0.

I’ve installed it without any problems and placed the tag {exp:mobile_detect location=“http://mysite.mobi”} at the very top of every page (above the DocType) on the website I would like to redirect mobile browsers away from.

Everything seems to be working perfectly, except it will also redirect non-mobile users who are viewing the website with Internet Explorer to my mobile site!  So basically the plug in seems to think that Internet Explorer (all versions) on a PC is a mobile device, and then redirects.  This can’t be right.  Am I missing something here?

Has anyone else experienced this problem?  Any support would be greatly received - I’m at a loss as to why this is happening.

Many thanks


Rich