Skip to content

Instantly share code, notes, and snippets.

@the-codepunker
Last active January 27, 2016 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save the-codepunker/b63d4b0e9053e3ec573b to your computer and use it in GitHub Desktop.
Save the-codepunker/b63d4b0e9053e3ec573b to your computer and use it in GitHub Desktop.
pmcomfort-logic
<?php
$input = JFactory::getApplication()->input;
$menu = JFactory::getApplication()->getMenu();
$menuitem = $menu->getActive();
$removeTopModules = false;
$removecomponent = false;
$class_suffix = (!empty($menuitem)) ? $menuitem->params->get('pageclass_sfx') : '';
if(!empty($menuitem) && $class_suffix=='removecomponent') {
$removecomponent = true;
}
if(!empty($menuitem) && $class_suffix=='removecomponent notonchildren') {
$removecomponent = true;
if($input->get('view','')=='article') {
$removecomponent = false;
$removeTopModules = true;
}
}
$load_default_nav = true;
$sess = JFactory::getSession();
//mainmenu contains the "root" elements that split the site in 2 residential / commercial
if(
$menuitem->menutype=="mainmenu" &&
in_array(strtolower($menuitem->title),
array('residential', 'commercial'))
) {
$sess->set('site_section_2zfgfasdew4', strtolower($menuitem->title));
}
$site_section = $sess->get('site_section_2zfgfasdew4', '');
if($site_section!='') {
$load_default_nav = false;
echo '
<div id="menubar" class="wrapper pm-header-menu grid-box width50 grid-h">
<nav id="menu">'.$this['modules']->render($site_section.'_menu_duplicate').'</nav>
</div>
<div id="above-menu-wrapper" class="pm-header-above-menu grid-box width25 grid-h">
'.$this['modules']->render('above-menu').'
</div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment