This topic is locked
[SOLVED]

 Show/Hide Navigation Links

8/29/2011 4:04:49 AM
PHPRunner General questions
C
chrisclements author

I am trying to show or hide navigation links based upon the page someone is viewing. So if they are looking at table1_list.php , I want to hide the navigation link in the menu for table2_list.php , but show the navigation link for table3_list.php.
I am guessing this can be done in the Modify Menu Item event, but I am looking for some sample code that would hide/show based upon the page they are currently viewing .
I tried this example but could not get it to work, http://www.asprunner.com/forums/topic/14807-how-to-show-different-menu-for-different-tables/
Please help.

C
cgphp 8/29/2011

In the "Menu item: Modify" event:

global $strTableName;
if($strTableName=="table1")

{

if($menuItem->table == "table2")

$menuItem->showAsLink = false;

if($menuItem->table == "table3")

$menuItem->showAsLink = true;

}
return true;
C
chrisclements author 8/29/2011



In the "Menu item: Modify" event:

global $strTableName;
if($strTableName=="table1")

{

if($menuItem->table == "table2")

$menuItem->showAsLink = false;

if($menuItem->table == "table3")

$menuItem->showAsLink = true;

}
return true;



Perfect... thanks!