For Components and for Modules I know we can get the active ID of an extension using JComponentHelper::getComponent("com_") and JModuleHelper::getModule("mod_").

However I want to be able to obtain the extension ID of lets say a package type. Is there a function in the current CMS libraries (preferable that will work in both 3.3 and 2.5) that will give me this result. After preliminary search of JInstaller and JInstallAdapter classes I have not found anything immediately useful. Otherwise I believe option 2 is to do a manual DB query to retrieve the desired ID, which I rather avoid if possible if Joomla is already providing such functionality.

1 Answer 1


I do not believe this is possible, primarily being because even though a package may be defined as a type of extension in the XML file, it's not really. The package as you probably already know packages up multiple extensions. When you create a new Menu Item, you cannot set the type to a package as it wouldn't know which extensions belonging to the package to call and display. Therefore there is no current package ID to be retrieved.

To get a package ID, you will need to write a small database query

  • Correct and I fully understand that about the menu item. My concern comes from external extension management while still using the JInstaller class. The fact that it seems difficult (outside writing my own query) to get any extension ID was the reason why I placed the question.
    – coder4life
    May 19, 2014 at 21:36
  • Do you wish to get it upon installation?
    – Lodder
    May 19, 2014 at 21:37
  • It is actually something I am experimenting with post installation for to troubleshoot some installation procedures. Basically I want to uninstall the package outside Joomla normal extension manager. JInstaller expects an ID. I know how to write a DB query to get the ID, that is not the problem. Ideally I am looking for knowledge if there is a way to retrieve the package ID but just passing a common name to a function just like the helper classes are providing for Components or Module. My goal here is to use the API functions if possible to be sticking to Joomla here a bit more.
    – coder4life
    May 19, 2014 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.