0
Welcome Guest! Login
0 items Join Now

Hide / show modules in mobile responsive layout

    • The Boss's Avatar
    • The Boss
    • Sr. Rocketeer
    • Posts: 176
    • Thanks: 1
    • Art Director / Motion Designer.

    Hide / show modules in mobile responsive layout

    Posted 11 years 6 months ago
    • Hello,
      I wonder if there's a way to hide or show some modules in a responsive template, following the user agent used to browse the website.

      So I wanna hide a module when the website is seen on a mobile and show another when the website is browsed on a large screen.

      Thanks in advance 8)
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Hide / show modules in mobile responsive layout

    Posted 11 years 6 months ago
    • Thats what the responsive support classes are made for.
      Just use them as mod suffixes.
    • The Boss's Avatar
    • The Boss
    • Sr. Rocketeer
    • Posts: 176
    • Thanks: 1
    • Art Director / Motion Designer.

    Re: Hide / show modules in mobile responsive layout

    Posted 11 years 6 months ago
    • Great, :D

      Are they listed within the tutorial of the template, or elsewhere ?

      Thanks a lot.
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Hide / show modules in mobile responsive layout

    Posted 11 years 6 months ago
    • The Boss's Avatar
    • The Boss
    • Sr. Rocketeer
    • Posts: 176
    • Thanks: 1
    • Art Director / Motion Designer.

    Re: Hide / show modules in mobile responsive layout

    Posted 11 years 6 months ago
    • Cool :cheesy:

      great help.

      Wish they included it within the tutorial of each responsive template, otherwise no one, will get to know this !!

      Thanks a lot Henning ...
    • The Boss's Avatar
    • The Boss
    • Sr. Rocketeer
    • Posts: 176
    • Thanks: 1
    • Art Director / Motion Designer.

    Re: Hide / show modules in mobile responsive layout

    Posted 11 years 6 months ago
    • Hello,

      I just faced a big problem with Adsense ads, as with using "Responsive support classes", the modules are still loading in fact, but are just hidden only!

      and specially if they contain a script as Google adsense ads.

      What I really want is not to load them at all on mobile phones, and load other modules instead.
      Hope you got the point.

      So, do you think there is a solution for this ?
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Hide / show modules in mobile responsive layout

    Posted 11 years 6 months ago
    • hmm yes thats the idea of the rsponsive support classes (and responsive design in general).
      Gantry offers some tools to detect mobiles via php.
      It would take some custom coding to build a condition in the php for that.
      This more than we can offer in this support forum.
    • The Boss's Avatar
    • The Boss
    • Sr. Rocketeer
    • Posts: 176
    • Thanks: 1
    • Art Director / Motion Designer.

    Re: Hide / show modules in mobile responsive layout

    Posted 11 years 6 months ago
    • Well yes I see...

      Thanks for your support, it has solved half of my issues, anyway :D
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Hide / show modules in mobile responsive layout

    Posted 11 years 6 months ago
    • I guess it could look like this

      <?php gantry_import('core.utilities.gantrymobiledetect'); ?>
      <?php $detector = new GantryMobileDetect(); ?>
      <?php if ($detector->isMobile()) : ?>

      soem code for my mobiles

      <?php endif; ?>

      ... just to give you some direction.
    • The Boss's Avatar
    • The Boss
    • Sr. Rocketeer
    • Posts: 176
    • Thanks: 1
    • Art Director / Motion Designer.

    Re: Hide / show modules in mobile responsive layout

    Posted 11 years 6 months ago
    • Thanks a lot for helping, Henning, ... but where should I insert this code? :o
      It seems not an easy thing to do, at least for me :)

Time to create page: 0.074 seconds