Text Size

Members login

Recommend Print

Hide unauthorized menu items in frontend

  • Published by
    Emmanuel Danan
  • Last modified
    08 March 2010
  • Voting
    (7 votes)
  • Favourites
    Add to favourites [5 users]
  • Concerns
    Component
  • Since Version
    1.0.3
  • Up to date
    Yes
  • Profile concerned
    End user, Webdesigner

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 offer this payed service very soon. Please contact us on the FLEXIaccess forum for that.

 

Latest Comments

Latest Forum Posts

Posted by Rehne - 04/02/2012 18:33
Posted by Rehne - 04/02/2012 17:50
Posted by Rehne - 04/02/2012 17:11
Posted by Arkadiy - 04/02/2012 14:34