0
Welcome Guest! Login
0 items Join Now

Access template params via joomla component

  • Access template params via joomla component

    Posted 11 years 8 months ago
    • G'Day, I have a custom component I have designed for Joomla 2.5. Currently I am using a Rockettheme template. The problem I am having is that my design in the component is not responsive so it looks terrible on iphone/android etc.

      Is there a way for me to access the rockettheme/gantry framework parameters (from my component) to see which layout the user is viewing. At the bottom of most sites the user has the ability to change which layout they view if using a mobile device via a desktop/mobile button at the bottom of the screen. I would like to access this setting.... and in my view.html.php file adjust which layout I will display.

      Is this possible? I haven't the slightest clue where to start with this...
    • Shazdeh's Avatar
    • Shazdeh
    • Elite Rocketeer
    • Posts: 4984
    • Thanks: 29

    Re: Access template params via joomla component

    Posted 11 years 8 months ago
    • Hi,
      you can retrieve any parameter by using the "get" method of the global $gantry object. Now, to check for the active layout you can try:
      global $gantry;
      $platform = $gantry->browser->platform;
      $enabled = $gantry->get($platform . '-enabled', 0);
      $view = 'viewswitcher-' . $gantry->get('template_prefix') . $platform . '-switcher';
      if ($enabled && JFactory::getApplication()->input->cookie->get($view, true, 'string') != '0') {
           // using iphone or android layout
      }
      See the gantry_run_alternate_template method in lib_gantry/gantry.php file.
    • Please don't PM unless requested ;)
      Consider using the custom stylesheet for all your CSS customizations: gantry-framework.org/documentation/wordp...custom_stylesheet.md .
      Please provide the URL to the issue.
      And please mark the thread as solved if the issue is resolved.

Time to create page: 0.060 seconds