Follow flexicontent.org
   
Text Size

Members login

Recommend Print

Hide unauthorized menu items in frontend

  • Published by
    Emmanuel Danan
  • Last modified
    08 March 2010
  • Voting
    (4 votes)
  • Favourites
    Add to favourites (3 users)
  • Concerns
    Component
  • 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.

 

Comments  

 
0 #1 Yeon Hong 2010-04-13 22:35
Thanks, it works great!!!
Quote
 
 
0 #2 Markus Rouenhoff 2010-08-06 09:42
Work this with FlexiAccess 1.0.5 ?

best regards
Quote
 

Add comment


Security code
Refresh

Community

poolp : Online 1305 mins fesghel : Online 2149 mins m4d3l : Online 2886 mins fgarat : Online 21402548 mins
Members Online: 4

Latest comments

Latest Posts

Posted by m4d3l - 10/09/2010 22:38
Posted by poolp - 10/09/2010 20:41
Posted by daled - 10/09/2010 20:16
Posted by orchid1 - 10/09/2010 20:09
Posted by fred - 10/09/2010 18:56
Posted by ThatComputerDude - 10/09/2010 17:32

Tag Cloud