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");
}
}