0
Welcome Guest! Login
0 items Join Now

Changing the way the Iphone Switcher Works

    • 's Avatar

    Changing the way the Iphone Switcher Works

    Posted 13 years 4 months ago
    • Hello... I finally found where the switcher control is in the gantry framework. It is located in com_gantry>features>viewswitcher.php
      function render($position="") {
                global $gantry;
                
                if (!$gantry->get($gantry->browser->platform . '-switcher-enabled')) return "";
                
                $prefix = $gantry->get('template_prefix');
                $cookiename = $prefix.$gantry->browser->platform.'-switcher';
                $cookie = JRequest::getVar($cookiename, false, 'COOKIE', 'STRING');
                $cls = (!$gantry->retrieveTemp('platform', $cookiename)) ? 'off' : 'on';
                
                ob_start();
                ?>
                <div class="clear"></div>
                <a href="#" id="gantry-viewswitcher" class="<?php echo $cls; ?>"><span>Switcher</span></a>
                <?php
                return ob_get_clean();
           }

      What I am wanting to do, and think should be included standard in the Gantry Framework, is to have below the switch (or above), text. When the switcher is showing "on" I'd like the text to read "Switch for full site" and when the switch is "off" have the text read "Switch for mobile site"

      Any thoughts?

      Thanks!

      Billy
    • Ben Lee's Avatar
    • Ben Lee
    • Elite Rocketeer
    • Posts: 4193
    • Thanks: 42

    Re: Changing the way the Iphone Switcher Works

    Posted 13 years 4 months ago
    • I think there is a setting in the template parameters that lets you turn this on. It may be in the newer gantry versions only, but not sure.

Time to create page: 0.035 seconds