How to get the parent menu id from the active menu id with the Joomla! 1.6 API

H
  1. This can be done using the getActive() method from the JMenu class with the Application subpackage. Read More here
  2. Anywhere in your Joomla! code use the following codeline to get the parent IDfor the active id.
    $parentID = JSite::getMenu()->getActive()->tree[0];

About the author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

About Author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

Follow Me