How to get the clicked menu item's $mlid in Drupal? -


I am trying to create a submenu based on $ mlid . I have found a task that seems to work but I can not know how to get the $ mlid of the menu item which was just clicked.

I found a function in a link on Same Post (SO), but I can only find examples where $ mlid is manually set any suggestions?

You can use the menu_get_item () function to get the information About the current page as a menu item, then create a query to get the database to get MLID.

  $ item = menu_get_item (); // current page $ mlid = db_result (db_query ("select MLID FROM {menu_links} where menu_router information is link_path = '% s'", $ item ['path']));  

Note - This applies to Dupl 6.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -