0
Welcome Guest! Login
0 items Join Now

SOLVED Different template for menu item

    • Ortix92's Avatar
    • Ortix92
    • Rocketeer
    • Posts: 56
    • Thanks: 0

    SOLVED Different template for menu item

    Posted 11 years 8 months ago
    • I'm using the gantry framework and for a specific argument passed to the URL, I want to prevent the footer and header from loading. The webpage will be loaded from an embeded device and will be opened as:
      www.exo-l.com/shop2?scanner=1

      As you can see the header and footer are not visible this way and ?tmpl=shopindex is appended to every url. However this is FAR from ideal since it causes a lot of trouble in how pages are redirected and popup boxes are opened.

      Anyone know a better solution? In other words:
      How do I prevent footer and header from loading -or- load a different template when a specific argument is passed and bind that template to the rest of the user's session. (so everything reverts to normal on logout)

      This is my feature I wrote which does this, but it's not effective at all.
       
          function init() {
              global $gantry;
       
      // removed some unnecessary code due to security
              if ($user->exists) {
                  header("Location: " . $gantry->getCurrentUrl . "/shop2/scanner-login?tmpl=shopindex&login=" . $email);
              } elseif (JRequest::getVar('tmpl') != 'shopindex' && (JRequest::getVar('scanner') == 1 || JFactory::getSession()->get('scanner') == 1 )) {
                  JFactory::getSession()->set('scanner', 1);
                  header("Location: " . $gantry->getCurrentUrl . "?tmpl=shopindex");
              }
          }
    • Who?'s Avatar
    • Who?
    • Preeminent Rocketeer
    • Posts: 25562
    • Thanks: 613
    • Joomla freelancer

    Re: SOLVED Different template for menu item

    Posted 11 years 8 months ago
    • I would recommend you to use Advanced Module Manager. It will help you to hide/show modules based on multiple rules and one of them is based on URL of the current page 8)
    • Check my services at: Mihha-Vision
    • Ortix92's Avatar
    • Ortix92
    • Rocketeer
    • Posts: 56
    • Thanks: 0

    Re: SOLVED Different template for menu item

    Posted 11 years 8 months ago
    • Not really looking for hiding modules as much as hiding actual gantry positions.

      But I've managed to do this by wrapping the positions in an if statement which checks if a certain session is set
    • MiD-AwE's Avatar
    • MiD-AwE
    • Jr. Rocketeer
    • Posts: 35
    • Thanks: 1

    Re: SOLVED Different template for menu item

    Posted 11 years 7 months ago
    • You can disable the positions on those pages through joomla!

      Uncheck the menu assignment in Joomla administrator for the specific page(s) content. If nothing is assigned to display on that page then Gantry will ignore the position and treat it like and empty
      <div></div>
      at most
      <div> _</div>

      Once no content is assigned to the position for the page your after then gantry should eliminate "by not requesting" positions from the server.
    • A wise person will not attempt to "reinvent the wheel" but use it along the way to greater things. GNU/GPL is the wheel of our age.

Time to create page: 0.052 seconds