Welcome, Guest
Username Password: Remember me

How can i show a module only for mobile devices?!
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: How can i show a module only for mobile devices?!

How can i show a module only for mobile devices?! 13 years, 10 months ago #3058

  • avra911
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Hello, i was wonder how can i show a module in the default site (desktop/standard version) only for mobile devices only. Just because i want to show Mobile Version link and Standard Version in the website only if the user agent is mobile and not for desktop users. thanks in advanced, razvan
i tried with: $MobileJoomla =& MobileJoomla::getInstance();
and $MobileJoomla->getMarkup() in the template,
but shows me Call to a member function getMarkup()
Last Edit: 13 years, 10 months ago by avra911.

Re: How can i show a module only for mobile devices?! 13 years, 10 months ago #3059

  • dryabov
  • OFFLINE
  • Administrator
  • Denis Ryabov, Lead Developer
  • Posts: 4867
  • Karma: 105
As to "Select Markup" module, such a behaviour is implemented in MJ0.9.11 (will be released today).

Re: How can i show a module only for mobile devices?! 13 years, 10 months ago #3060

  • avra911
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
so i can use the code from mod_mj_markupchooser.php to get $saved_markup?
when i use: $MobileJoomla_Device['markup'] in the iphone template is showing the device name, browsing with the mobile phone. but when i add the code in the "desktop"/"standard" template is showing nothing, still browsing with the mobile
Last Edit: 13 years, 10 months ago by avra911.

Re: How can i show a module only for mobile devices?! 13 years, 10 months ago #3061

  • dryabov
  • OFFLINE
  • Administrator
  • Denis Ryabov, Lead Developer
  • Posts: 4867
  • Karma: 105
look at current code:
github.com/mobilejoomla/mobilejoomla/blob/master/modules/mod_mj_markupchooser/mod_mj_markupchooser.php

The check is based on $MobileJoomla_Device['real_markup'] variable. It should be equal to false or '' (empty string) for PC browsers. But note that this variable have been introduced in MJ 0.9.11 and the code will not work in previous versions of MJ.

Re: How can i show a module only for mobile devices?! 13 years, 10 months ago #3062

  • avra911
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
ok, i wait until 0.9.11 is released

i tried to install mobilejoomla-mobilejoomla-1601d6f.tar but give me blank page
thanks,
razvan
  • Page:
  • 1
Time to create page: 0.18 seconds

By continuing to use this site you consent to the use of cookies on your device as described in our cookie policy unless you have disabled them. This site will not function correctly without cookies.

I accept cookies from this site.