I have a component listed on the JED that I am currently updating to fix a bug. I noticed however that when creating a custom Administrator menu in the backend, my component does not show up in the list of available installed components to create a link from. I was wondering what I need to change in my extension XML file so that my component shows up in that component list.
To reproduce the issue:
Create an Administrator menu in the backend Add a new menu item When selecting the Menu Item Type a list opens of available components
The Menu Item Type list is where I am trying to get me component to show. Any guidance would be appreciated.
I use Component Creator to create all my components in the first instance so my answer is related to the way they code components to a large degree. I've personally never created an Admin menu item before so I had to see if my components actually let me do this, and it did. So in the main manifest XML you will need to have a menu and perhaps a submenu element defined and I'm hoping that the following example of code helps.
<administration> <menu img="../media/com_mycomponent/images/s_com_mycomponent.png" >COM_MYCOMPONENT</menu> <submenu> <menu link="option=com_mycomponent&view=clientadverts" view="clientadverts" img="../media/com_mycomponent/images/s_clientadverts.png" alt="Mycomponent/Clientadverts">COM_MYCOMPONENT_TITLE_ADVERTS</menu> <menu link="option=com_categories&extension=com_mycomponent" view="categories" img="../media/com_mycomponent/images/s_clientadverts.png" alt="Mycomponent/Categories">COM_MYCOMPONENT_ADVERTS_ADVERT_TYPE</menu> </submenu>
This seems to work in the same way as creating front end menu item types, but with your
default.xml file being saved under an administrator view rather than a front end view.
For example, com_content adds the featured articles link under
This file contains the following code
<?xml version="1.0" encoding="utf-8"?> <metadata> <layout title="COM_CONTENT_FEATURED_VIEW_DEFAULT_TITLE"> <message> <![CDATA[COM_CONTENT_FEATURED_VIEW_DEFAULT_DESC]]> </message> </layout> </metadata>
Adding the same (changing only the title and message) to your component's administrator view(s) should make it/them appear under Menu Item Type.
Com_content is using translations, as any JED component should, but you could easily test this by replacing
COM_CONTENT_FEATURED_VIEW_DEFAULT_TITLE with dummy text.