Free: Mobile Detection Pluginzur Erkennung von mobilen Geräten in Joomla!

Heute haben wir wieder ein kostenloses Free Joomla! Plugin für alle Joomla-Anwender (Joomla! 2.5, 3.x und höher) im Gepäck - es hört auf den selbsterklärenden Namen "yagendoo Joomla! Mobile Detection".

Das Plugin ist wirklich simpel aufgebaut und hilft Anwendern und Entwicklern in ihrem Code abzufragen, ob das Gerät mit dem die Webseite gerade besucht wird, ein mobiles Gerät, wie ein Handy oder ein Tablet-PC ist oder nicht.

Zudem können viele weitere Informationen wie das Betriebssystem, der Useragent oder der genaue Typ des mobilen Geräts abgefragt und oder genutzt werden.

Insbesondere auch beim Thema "Responsive Webdesign" kann man mit dem "yagendoo Joomla! Mobile Detection" wirklich cooles Zeug anstellen - der geneigte Anwender und Entwickler weiß Bescheid und wird es zu nutzen wissen. ;-)

Zwar gibt es in Joomla! bereits eine Funktion, die eigentlich genau dies tun soll, allerdings tut Joomla! selbst -aufgrund der Komplexität des Themas- dies nicht zuverlässig genug, was natürlich fast in der Natur der Sache liegt, da die Anzahl an unterschiedlichen mobilen Geräten und deren Betriebssysteme rasant wächst.


Hier könnt ihr euch die jeweils aktuellste Version des Plugins herunterladen.

Plugin herunterladen


Das Plugin ist kostenlos für Privatpersonen oder Unternehmen verfügbar und ist unter der GNU/GPLv3 veröffentlicht. Ihr dürft das Plugin für eure eigenen Seiten nutzen, es auf anderen Webseiten verwenden oder ein eigenes Plugin darauf basierend erstellen und es weiter verbreiten. Alle Copyrights im Code müssen erhalten bleiben.

Verfügbare Funktionen

Folgende Funktionen stehen im "yagendoo Joomla! Mobile Detection" zu Verfügung.





MobileDetector::isTablet($userAgent = null, $httpHeaders = null);

MobileDetector::is($key, $userAgent = null, $httpHeaders = null);



Das Plugin basiert auf der ebenfalls frei erhältlichen (MIT) Code-Libary von Șerban Ghiță, die das eigentliche Herz des Plugin bildet. Danke für deine tolle Arbeit Șerban!

Und euch viel Spaß mit dem Plugin. Wenn euch das Plugin gefällt, könnt ihr hier den Ursprünglichen Entwickler hier unterstützen.

Kommentare (34)

  1. Robert Went

Great stuff

I was about to build this into my template but I guess now there is no need.
Are there any limitations on usage? Ie. can I use it in the main index file of a template and in any override?

Thanks for your work on this!

  1. Yannick Spang   Robert Went

Hey Robert,

there is no limitation. You can use it wherever you need it!

Kind regards,

  1. Robert Went   Yannick Spang

Perfect! I think I might build a few options for it into my new template

  1. nick

I've got the plugin installed and working, but am having trouble understanding how to use the MobileDetector::isMobile(); function.

For example, I want to detect if it's a mobile/tablet device and redirect to a sub-domain.

Could you provide any examples of using the functions?


  1. Simon

Hello Nick,

the "isMobile" methods returns true if a mobile device is detected, so in your case an example code would look like:
if(MobileDetector::isMobile() === true)
// mobile device detected do redirect
header('Location:', true, 301);

  1. Ian Wensink


This plugin looks like the one I need, but I really have no idea of how to use it. I clicked 'download plug-in' which gave me a zip with a php script. What should I do now? Where do I have to put the file or the code? And can you explain step by step how to use the plugin? So what do I have to do so the visiter gets to an other page like the question above. I'm not very expert in php, so if you could explain everything it would be very handy.

Thanks in advantage,
Ian Wensink

  1. Yannick Spang   Ian Wensink

Hello Ian,

just install it via the Joomla installer. But if you want use it, it´s required to have some PHP-skills. It´s mainly developed for other developers.

Currently we can´t provide a step-by-step guide, because of lack of time. I am sorry!!

Kind regards,

  1. Sammy

Hi Yannick,

I want once it detects mobile device, to redirect to a sub domain. I've read the comments here and I have one question.

Where do I place this code?

if(MobileDetector::isMobile() === true)
// mobile device detected do redirect
header('Location:', true, 301);

On the root index page or on the template index page?

Kind regards,


  1. Yannick Spang   Sammy

Hey Sammy,

if you place it in the root index file, it is a hack what maybe will overrided by a Joomla update. I think you should put it in your template index, if you only use one template.

Best regards,

  1. Boldee

I originally used the php mobile detect code directly in my index.php this plugin is a real time saver thank-you for that.

I have a question however, is there a way to override mobile detection so that users have an option to view the desktop version of the site from the mobile device via a redirect?

  1. Yannick Spang   Boldee

Hello Boldee,

currently not - I am sorry, but we work on something like that. Sorry to say, that I can´t give you a timeframe for now.

Kind regards

  1. Boldee

Hi YannickS
Thanks for the reply.

If you can get a function working in the future for redirection that would a be great asset for this plugin.

I did a little research after posting here about whether my website users actually want to be forced to use a mobile site or have a choice of desktop or mobile and it was a split 50 50, so I have decided to take a different approach, I am however still using this great plugin all be it slightly different to how I originally intended

  1. Rob

I think you would have to set a cookie and then check for it before redirecting.

Then you can direct to the mobile if nothing is set and if they choose desktop set a cookie which would be picked up the next time the page is loaded and then not redirect.

  1. F   Rob

Hello Rob,

I find your advice helpfull. I'm trying different approaches on preventing further redirection with cookies the whole day and non of them worked. I get always redirected. Could you please provide an example?

Here is what I'm trying in Joomla:

if(MobileDetector::isMobile() === true && isset($_COOKIE['mobile']))
// problem is here:
MobileDetector::isMobile() === false;
// tried even: return false; | $detect = "false";
// none working
elseif(MobileDetector::isMobile() === true)
header('Location:', true, 301);

And in the mobile site:

setcookie("mobile","m", time()+3600, "/");


I followed this example ( as well, but it won't work directly with the yagendoo Joomla plugin:

isMobile() && isset($_COOKIE['mobile']))
$detect = "false";
elseif ($detect->isMobile())

Thank you!

  1. Nick N

Neither one of these actually works. I have a Galaxy S4 and neither one shows information when echoing these below. User agent works and detecting if mobile works but not these.



  1. Dragma

Hi! thanks for this incredibly useful plugin. I have a problem, I wonder if you can help.
I did an if/else to hide a particular module when loading on mobile devices, but it still loads it. Here is the code simplified:
countModules('login')) : ?>

Thank you,

  1. Michael

First of all, thank you for this handy plugin!

When i activate Joomla cache, it doesn't work as expected, though. I use the plugin in order do distinguish between desktop and mobile navigation. When i browse the site simultaneously on a desktop and a mobile browser i often get the wrong site elements with cache turned on.

Did anybody encounter the same problems yet and is there a solution?


  1. Michael   Michael

FYI: we managed to bypass the problem by using a thirdparty cache extension.

  1. Filip

Can anyone provide an example of "View full site" redirection with cookie?
I try to avoid loop redirections to the site's mobile version.
I tried something like this, but it always ends with loading the mobile site:
if(MobileDetector::isMobile() === true && isset($_COOKIE['mobile']))
return false;
} else {
header('Location:', true, 301);

... and on the mobile landing page:
setcookie("mobile","m", time()+3600, "/");


  1. Guest!

404 not found on download link!

  1. Yannick Spang   Guest!

Thanks for the information - download link is fixed!

  1. Nik


The plugin works perfect! But I want to know if there is a way to check if the user is on an iPhone?
Maybe something like this?: $phone = MobileDetector::getPhoneDevices();
if($phone == "iPhone")
do something...

  1. Jonathan Roza


First, I would like to tell that it seems to be a very promising plugin (didn't use it yet).
My question is: Can I "load a module if it is mobile", or "not load a module if it is mobile"?


(forgive me the IsNOTMobile, but I don't know the proper command to detect a "not mobile browser". Maybe it's something like !isMobile?).


  1. Guy

I need some help! I'm trying to use this plugin in Joomla-virtuemart on a default_products.php page that gets displayed in an html template, without success.

I originally tried Serbanghita's plugin without luck and them tried this Joomla plugin.

I'm assuming I don't need to call the plugin up on any page, once it's installed and actiavted?

I'm trying to use the output to create a conditional callup - and it's not working:

// Show Products ?>
isMobile() && !$detect->isTablet() ) { ?>

The end result is, whatever appears above that conditional segment appears live but without any formatting, and whatever should appear from that conditional segment onwards doesn't get displayed at all. What am I doing wrong?

  1. Tobias   Guy


once the plugin is installed you should be able to call it using this code:

if(MobileDetector::isMobile() === true)
// do something

Kind regards,

  1. IanE

I thought I had this working perfectly but it detects Chrome on a desktop as mobile, all other browsers I've tried (desktop and Android) work ok, any thoughts as to why this should be? I've tried on a completely different machine and it's exactly the same, use Chrome (Version 41.0.2272.89 m) from a desktop and the plugin thinks I'm mobile.



  1. IanE

Ignore my earlier post regarding Chrome (unless you've come here with the same problem) I downloaded the plugin again and it's working fine now so I guess there must have been an update.

Thanks for a really useful solution.


  1. Alex

Hi, how do I script the code to see if a device is using the android stock browser?

  1. Alex

Hi, how do I script a query to see if the browser is the Android stock browser?

  1. Alex

Hi, how do I write the query to detect if a browser is the Android Stock browser?

  1. Alex there also a way of identifying the Chrome browser on Android devices?

  1. Ross

Hi there!
How can I find if visitor is using the tablet? Because there is no function or method "MobileDetector::isTablet();". And how can I find what OS is using by visitor? I need to know if it's iOS. Can You show some examples or link to documentation? Thank You!

  1. stuart

how can hidde modules?

  1. Madhvee

With reference to the following post:

Michael Thursday, 13 March 2014
FYI: we managed to bypass the problem by using a thirdparty cache extension.

Can you please provide more details?
I have same issue - plugin does not work when cache is on.


There are no comments posted here yet

Einen Kommentar verfassen

0 Characters
Anhänge (0 / 3)
Share Your Location

Sie brauchen technische Unterstützung?

Wir helfen bei Problemen und erstellen ganze Webseiten und Onlineshops für Sie!

Yagendoo Media Team

Jetzt Anfragen.

» Referenzen «