views:

450

answers:

2

I'm trying to build a submenu based on $mlid. I've found a function that appears to do the job, but I just can't seem to figure out how to get the $mlid of the menu item that was just clicked.

I found the function in a link on similar post here on SO (http://drupal.org/node/249257), but I can only find examples where the $mlid is set manually. Any suggestions?

+1  A: 

You can use the menu_get_item() function to get information about the current page as a menu item, then make a query to the database to get the mlid.

$item = menu_get_item(); //Gets menu_router information for current page
$mlid = db_result(db_query("SELECT mlid FROM {menu_links} WHERE link_path=%s", $item['path']); 
emmychan
A: 

Aren't you really looking for the Menu Block module?

marcvangend

related questions