Hide menu-items in other menu-modules then the Joomla menu-module

You can hide menu-items also in other menu-modules then the Joomla menu module. For this you need to alter the code of your menu-module to make it work with FUA. Here is how.

We can not provide downloads of installable template or menu's which have already been fixed. This is because of legal reasons. Thats why we provide these codes so you can alter the menu yourself. We regret we can not make this any easyer for you.

If you can't work this out, please contact us using the contact form.

   

Artiseer

Artiseer templates get the menu-data from Joomla mod_mainmenu (joomla 1.5) or mod_menu (joomla 1.6 & 1.7) and then uses a template override to display them in styled horizontal or vertical manner.

To filter menu items in the menu-modules, make sure the menu-item override is enabled in FUA > configuration > 'menu access'.

   

at_menu in atict.com joomla templates

At_menu templates got a nice build in top menu, which needs this code-fix to hide menu-items as set by FUA.

file:

templates/template_name/at_menu/base.class.php

line: 51

$rows = $items->getItems('menutype', $this->getParam('menutype'));

change to:

$rows = $items->getItems('menutype', $this->getParam('menutype'));        
            
//start filter menu items
$menu_type_to_filter = $this->getParam('menutype');// $params->get('menutype') or $this->getParam('menutype')
if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
    require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
    $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
    $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, $menu_type_to_filter);
}   
//end filter menu items

For the vertical-menu's, you can use the normal Joomla menu module. To filter menu items in the menu-modules, make sure the menu-item override is enabled in FUA > configuration > 'menu access'.

   

CloudBase

Cloudbase got a nice build in top menu, which needs this code-fix to hide menu-items as set by FUA.

file:

templates/cloudbase/libs/menu/base.class.php

line: 51

$rows = $items->getItems('menutype', $this->getParam('menutype'));

change to:

$rows = $items->getItems('menutype', $this->getParam('menutype'));        
            
//start filter menu items
$menu_type_to_filter = $this->getParam('menutype');// $params->get('menutype') or $this->getParam('menutype')
if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
    require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
    $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
    $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, $menu_type_to_filter);
}   
//end filter menu items

For the vertical-menu's, you can use the normal Joomla menu module. To filter menu items in the menu-modules, make sure the menu-item override is enabled in FUA > configuration > 'menu access'.

   

CustoMenu

File: modules/mod_customenu/customenu/helper.php

find this code around line 42:

$items = modCustoMenuHelper::getItems();

replace with:

$items = modCustoMenuHelper::getItems();        

        //start filter menu items
        if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
             require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
             $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
             $items = $frontenduseraccessMenuAccessChecker->filter_menu_items($items, 1);
        }   
        //end filter menu items

   

DT Menu

file:

modules/mod_dtmenu/mod_dtmenu.php

line: 192

$menu_items = $database->loadObjectList('id');

replace with:

$menu_items = $database->loadObjectList('id');                

                //start filter menu items
                if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
                     require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
                     $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
                     $menu_items = $frontenduseraccessMenuAccessChecker->filter_menu_items($menu_items, 1);
                }   
                //end filter menu items

   

Exmenu

Exmenu is a fantastic menu-module, with many templating possibilities.

version: 1.0.6

file: /modules/mod_exmenu-j15/exmenu/loader/menu.menuloader.class.php

line: 152

$orphanedIds        = array();

replace with:

$orphanedIds        = array();
//start filter menu items
if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
     require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
     $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
     $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, 1);
}   
//end filter menu items 

 

   

Gavick template menu

Example from the gk_musicity template.

file:
templates/gk_musicity/libs/menu/base.class.php

line:
59

$rows = $items->getItems('menutype', 'mainmenu');

replace with:

$rows = $items->getItems('menutype', 'mainmenu');
                            
            //start filter menu items 
            if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){ 
            require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php'); 
            $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();            
            $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, 1); 
            }    
            //end filter menu items

   

Joomla's own menu module 'mod_mainmenu' and 'mod_menu'

To filter menu items in the menu-modules, make sure the menu-item override is enabled in FUA > configuration > 'menu access'.

The fix underneath is only needed if you enabled the mod_mainmenu/mod_menu override in the FUA configuration AND get an error at the frontend of the site. This happens when another menu-module conflicts with FUA. In that case you can use this fix to filter the menu-items without conflicting with the conflicting menu-module.

Of course we do not want you to hack the Joomla core, so you can do this with a module-override for 'mod_mainmenu' (joomla 1.5) / mod_menu (joomla 1.6 & 1.7) in your template's folder.

Check if your template is already using a module override for 'mod_mainmenu' (joomla 1.5) / mod_menu (joomla 1.6 & 1.7).
Check if this folder exists:


/templates/template_name/html/mod_mainmenu (joomla 1.5)

/templates/template_name/html/mod_menu (joomla 1.6 & 1.7)

if the folder is not there, read on at 'create joomla menu override'.
if the folder is already there, read on at 'altering existing mod_mainmenu override (Joomla 1.5)' or 'altering existing mod_mainmenu override (Joomla 1.6 & 1.7)'

  • create Joomla menu override

  1. Download the module-override
  2. Unzip the zip file
  3. Read the installation instructions inside. (create the folder and upload the 2 files).

  • altering an existing mod_mainmenu override (Joomla 1.5)

The Frontend-User-Access menu module needs to be installed for this to work. It does not need to be enabled.

If your template has already got a module-override for the Joomla menu module, you might be able to alter it.

file: /templates/template_name/html/mod_mainmenu/default.php

find this line at the top of the file:

defined('_JEXEC') or die('Restricted access');

change to:

defined('_JEXEC') or die('Restricted access');if(file_exists(JPATH_ROOT.DS.'modules'.DS.'mod_frontenduseraccessmenu'.DS.'helper.php')){    
    require_once(JPATH_ROOT.DS.'modules'.DS.'mod_frontenduseraccessmenu'.DS.'helper.php');
}

AND

find a line like:

modMainMenuHelper::render($params, 'modMainMenuXMLCallback');

change to:

modFrontendUserAccessMenuHelper::render($params, 'modMainMenuXMLCallback');

If the file does not contain any code like this, as a last resort you can alter 'mod_mainmenu' as described at the bottom of this page.

  • altering an existing mod_menu override (Joomla 1.6 & 1.7)

If your template has already got a module-override for the Joomla menu module, you might be able to alter it.

file: /templates/template_name/html/mod_menu/default.php

find this line at the top of the file:

defined('_JEXEC') or die;

change to:

defined('_JEXEC') or die;                       
//start filter menu items
if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
     require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
     $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();          
     $list = $frontenduseraccessMenuAccessChecker->filter_menu_items($list, 1);
}  
//end filter menu items

   

JoomlaJunkie

JoomlaJunkie uses different types of menu's.

JoomlaJunkie suckerfish menu

This example is from Ario, but might also work on other templates by them.

file: /templates/template_name/jj_suckerfish.php

find this code:

$rows = $sql->loadObjectList( 'id' );

replace by:

$rows = $sql->loadObjectList( 'id' );
//start filter menu items
if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
     require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
     $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
     $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, 1);
}   
//end filter menu items 

Joomla's menu module in JoomlaJunkie template

The template loads the menu-data from Joomla mod_mainmenu (joomla 1.5) or mod_menu (joomla 1.6 & 1.7) and then uses a template override to display them in styled horizontal or vertical manner.

To filter menu items in the menu-modules, make sure the menu-item override is enabled in FUA > configuration > 'menu access'.

   

Joomlart

Some Joomlart templates get the menu-data from Joomla's menu module, other templates render the menu-items themselves. The easyest way to find out how the template is rendering its menu-items is to enable the menu-override in the FUA configuration > 'menu access'. Then check if the menu-item(s) are hidden in the menu. If not, the template is rendering the menu-items outside the Joomla core. In that case, apply one of the fixes underneath. If your template is not here, feel free to contact us, and will send you the fix.

This example is from the ja_sulfur template.

file: /templates/ja_sulfur/ja_menus/Base.class.php

line: 58

$rows = $items->getItems('menutype', $this->getParam('menutype'));

change to:

$rows = $items->getItems('menutype', $this->getParam('menutype'));

            //start filter menu items 
            if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){ 
            require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php'); 
            $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();            
            $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, 1); 
            }    
            //end filter menu items

This example is from the ja_kyanite_ii template.

file: /templates/template_name/libs/menu/base.class.php

line: 51

$rows = $items->getItems('menutype', $this->getParam('menutype'));

change to:

$rows = $items->getItems('menutype', $params->get('menutype'));

//start filter menu items
if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
     require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
     $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
     $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, 1);
}   
//end filter menu items 

 

This example is from the ja_purity_ii template.

file: /templates/template_name/libs/menu/base.class.php

line: 52

if(!count($rows)) 
                $rows = $items->getItems('menutype', 'mainmenu');

change to:

if(!count($rows)){
                $rows = $items->getItems('menutype', 'mainmenu');
            }
                        
            //start filter menu items
            if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
                 require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
                 $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
                 $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, 1);
            }   
            //end filter menu items
           

   

Joomlart T3 framework

Joomlart's T3 framework is a template-framework which is also used by other template makers (Theme Survivor, Joomagic, Themecraft, Joomla Mart, ThemeSoul and many more).

To make FUA work with the T3 framework:

file: plugins/system/jat3/jat3/core/menu/base.class.php

line: 55

$rows         = $menu->getItems('menutype',$this->getParam('menutype'));

change to:

$rows         = $menu->getItems('menutype',$this->getParam('menutype'));
//start filter menu items
if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
    require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
    $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
    $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, 1);
}   
//end filter menu items

   

Maxi Menu CK

In Joomla 1.7

file: modules/mod_maximenu_CK/helper.php

line: 157

$items = $menu->getItems('menutype', $params->get('menutype'));
  

change to

$items = $menu->getItems('menutype', $params->get('menutype'));            

        //start filter menu items
        if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
             require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
             $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
             $items = $frontenduseraccessMenuAccessChecker->filter_menu_items($items, 1);
        }   
        //end filter menu items

In Joomla 1.5

file: modules/mod_maximenu_CK/helper.php

line: 125

$rows = $db->loadObjectList('id');  
  

change to

$rows = $db->loadObjectList('id');        

        //start filter menu items
        if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
             require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
             $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
             $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, 1);
        }   
        //end filter menu items

 

   

Rockettheme RoknavMenu

Rockettheme comes with its own menu-module. The menu-module does often not have to be published in the module manager, the template simply uses the menu-modules code in the background. So althou the menu-module is not published, it is used.

To make the menu-module work with FUA, alter the code as such:

In mod_roknavmenu version 2.2 (maybe earlyer then 2.2, but later then 1.8, 2.2 is confirmed)

you need to alter this file:

modules/mod_roknavmenu/lib/providers/RokMenuProviderJoomla.php

find this code (around line 32-46):

$rows = $menu->getItems('menutype', $args['menutype']);

replace with:

$rows = $menu->getItems('menutype', $args['menutype']);
            
            
            //start filter menu items
if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
    
     require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
     $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
     $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, 1);
}   
//end filter menu items

In older versions of the Roknav menu, use this fix:

/modules/mod_roknavmenu/helper.php

find this code:

$rows = $items->getItems('menutype', $params->get('menutype'));

change this to:

$rows = $items->getItems('menutype', $params->get('menutype'));  
//start filter menu items
if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
     require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
     $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
     $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, 1);
}   
//end filter menu items 

   

Shape5 accordion menu

Alter the modules helper file to hide menu-items as described at the bottom of this page.

file: /modules/mod_s5_accordion_menu/helper.php

   

Shape5 menuhelper

Some Shape5 templates seem to work with a menuhelper to get the menu from the database. In that case, you will have to alter the helper-file.

This example comes from the Vertex-template.

File:

/templates/template_name/s5flex_menu/helpers.php

find this code:

$items  = $menu->getItems('menutype',$menu_type);

replace with:

$items  = $menu->getItems('menutype',$menu_type);
//start filter menu items
if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
     require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
     $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();
     $items = $frontenduseraccessMenuAccessChecker->filter_menu_items($items, 1);
}
//end filter menu items

   

Shape5 Suckerfish & NoMoo-menu

suckerfish

file: /templates/template_name/s5_suckerfish.php

no moo menu

file: /templates/template_name/s5_no_moo_menu.php

 

find this code:

$rows = $database->loadObjectList( 'id' );
 
 echo $database->getErrorMsg();
 $sql = "SELECT m.* FROM #__menu AS m"
 . "\nWHERE menutype='". $menutype ."' AND m.published='1'"; 
 $database->setQuery( $sql );
 $subrows = $database->loadObjectList( 'id' );

replace by:

$rows = $database->loadObjectList( 'id' );
echo $database->getErrorMsg();
 $sql = "SELECT m.* FROM #__menu AS m"
 . "\nWHERE menutype='". $menutype ."' AND m.published='1'"; 
 $database->setQuery( $sql );
 $subrows = $database->loadObjectList( 'id' );
//start filter menu items
if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
     require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
     $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();
     $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, 1);
     $subrows= $frontenduseraccessMenuAccessChecker->filter_menu_items($subrows, 1);
}   
//end filter menu items

   

Superfish Menu

  • Joomla 1.7
    You need to alter this file:
    modules/mod_jt_superfish_menu/helper.php

    look for the code that gets the menu-items from the database around line 48:

    $items         = $menu->getItems('menutype',$params->get('menutype'));


    replace with:

    $items         = $menu->getItems('menutype',$params->get('menutype'));
            
    //start filter menu items
    if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
         require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
         $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
         $items = $frontenduseraccessMenuAccessChecker->filter_menu_items($items, 1);
    }   
    //end filter menu items

  • Joomla 1.5
    The superfish module get the menu-data from Joomla mod_mainmenu (joomla 1.5) and then uses a template override to display them in a stylish manner.

    To filter menu items in the menu-modules, make sure the menu-item override is enabled in FUA > configuration > 'menu access'.
   

swMenuPro

file: modules/mod_swmenupro/functions.php
find this line (about 46):

return $final_menu;


change to:

//start filter menu items
    if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
         require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
         $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
         $final_menu = $frontenduseraccessMenuAccessChecker->filter_menu_items($final_menu, 1);
    }   
    //end filter menu items  

    return $final_menu;


   

Vertical Accordion Menu

The Vertical Accordion Menu by offlajn.com gets the menu-data from Joomla mod_mainmenu (joomla 1.5) or mod_menu (joomla 1.6 & 1.7) and then uses a template override to display the menu in a stylish accordion manner.

To filter menu items in the menu-modules, make sure the menu-item override is enabled in FUA > configuration > 'menu access'.

   

YOOtheme templates

YOOtheme templates get the menu-data from Joomla mod_mainmenu (joomla 1.5) or mod_menu (joomla 1.6 & 1.7) and then uses a template override to display the menu in a stylish manner.

To filter menu items in the menu-modules, make sure the menu-item override is enabled in FUA > configuration > 'menu access'.

   

ZooTemplate

This example is from the zt_cara16-template by ZooTemplate for Joomla 1.6-1.7.

file:

templates/zt_cara16/zt_menus/zt.common.php

line:

128

$rows     = $menus->getItems('menutype', $this->_type);

replace with

$rows     = $menus->getItems('menutype', $this->_type);
        //start filter menu items
if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
     require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
     $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
     $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, 1);
}   
//end filter menu items

   

All other menu-modules

Your menu-module probably has a helper-file here:

/modules/mod_modulename/helper.php

look for the code that gets the menu-items from the database:

$rows = $items->getItems('menutype',  $params->get('menutype'));  

Change that line to:

$rows = $items->getItems('menutype', $params->get('menutype'));

//start filter menu items
if(file_exists(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php')){
     require_once(JPATH_ROOT.DS.'components'.DS.'com_frontenduseraccess'.DS.'menuaccess.php');
     $frontenduseraccessMenuAccessChecker = new frontenduseraccessMenuAccessChecker();           
     $rows = $frontenduseraccessMenuAccessChecker->filter_menu_items($rows, 1);
}   
//end filter menu items


   














   
 
Follow Us On Twitter