Breadcrumbs
Home / Documentation / FLEXIaccess ACL / Menu itemsHide unauthorized menu items in frontend
- First, you set the permissions of the menu item via FLEXIaccess
- Second , if you edit the menu item e.g. to change title, DO NOT SET -any- access level
-Third, you’ll need to override your template to hide unauthorized menu items.
Copy the file
modules/mod_mainmenu/tmpl/default.php
In
templates/your_template/html/mod_mainmenu/default.php
This file may already be in.
Edit it and find the lines:
if ($child->attributes('access') > $user->get('aid', 0)) {
$node->removeChild($child);
}
Replace it by:
if (FLEXI_ACCESS) {
if (!FAccess::checkAllItemReadAccess('com_content','read','users',$user->gmid,'menu',$child->attributes('id'))) {
$node->removeChild($child);
}
} else {
if ($child->attributes('access') > $user->get('aid', 0)) {
$node->removeChild($child);
}
}
And that’s all.
NOTE: Some template providers use specific menu systems that could require a particular adaptation. We will to do this manually


Latest Comments
How to display a message in the frontend item view...
Wednesday 11:47
Thank you very much!! Can you also decribe the cod...
Thursday 10:06
Yes edit button for category view is now available...
Tuesday 08:04
Please post such questions in the forum
Thursday 08:11