Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Show and hide a module based on a mobile or computer browser

Show and hide a module based on a mobile or computer browser

Can I controll which module on my website that will be shown based on if it´s a smartphone or a computer. I want it to switch between 2 modules. Only one module would be shown at a time.

I want to change the module that will be shown based on a smartphone or a person sitting at a computer.

Edited By: fjernsyn01
21-Feb-13 06:42:51

fjernsyn01
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: Show and hide a module based on a mobile or computer browser

I have made this on if ( $core_genius->check( "browser_type = iphone, ipod, ipad, android" ) ) return 30;
else return 29;

But all the time I get this error

Fatal error: Call to a member function get() on a non-object in /var/www/XXXXXX.dk/public_html/modules/mod_metamod/helper.php on line 366

fjernsyn01
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: Show and hide a module based on a mobile or computer browser

Hi,

what exact version of Joomla are you using? The line that's causing the error may cause a problem on Joomla 1.7 and possibly earlier versions of J2.5 but should be fine on all current versions.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Re: Show and hide a module based on a mobile or computer browser

Oh, and on your 1st question, there's really good detection of mobile vs. desktop vs. tablet vs. tv devices. Try this way (once the other part is working):

if ( $core_genius->check( "categorizr = mobile,tablet" ) ) return 30;
else return 29;


Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Re: Show and hide a module based on a mobile or computer browser

I will use your instead looks like it will cover it all. And yes you where right. I´m helping with a website and did not check the version and as you said it was a joomla 1.7 :-) . Good to learn the importence of a upgrade. But my works but will try to use your. Thanks so much.

Michael

fjernsyn01
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: Show and hide a module based on a mobile or computer browser

Joomla 1.7 is way out of date and unsupported, so if at all possible you should be working to upgrade to Joomla 2.5.

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Re: Show and hide a module based on a mobile or computer browser

I did and it worked just like you said. Thanks so much for your help.

fjernsyn01
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: Show and hide a module based on a mobile or computer browser

I have made this on if ( $core_genius->check( "browser_type = iphone, ipod, ipad, android" ) ) return 30;
else return 29;

i have J!2.5 but it doesnt works.

javi_rp88
Guest
useravatar
Offline
Administrator has disabled public posting

Re: Show and hide a module based on a mobile or computer browser

with android it works, but in the same smartphone i change for another browser like Chroma, Firefox it doesnt work!!

Any solutions???

Thanks

javi_rp88
Guest
useravatar
Offline
Administrator has disabled public posting

Re: Show and hide a module based on a mobile or computer browser

i also use:

if ( $core_genius->check( "categorizr = mobile,tablet" ) ) return 30;
else return 29;

but it doesnt work

I NEED HELP!!!!!!!!!!!!

javi_rp88
Guest
useravatar
Offline
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5909
Posts this week:
1
User Info:
 
Total Users:
10112
Newest User:
chris28464
Members Online:
0
Guests Online:
109

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked