2

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.

2

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 administrator/com_content/views/featured/default.xml

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.

  • I am going to try this out today @Richard B. I will let you know if it solved my problem. – Terry Carter Oct 10 '17 at 21:51
  • Yep. This was the correct answer. Great solution and thanks Richard B. – Terry Carter Oct 10 '17 at 22:00
1

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&amp;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&amp;extension=com_mycomponent" view="categories" img="../media/com_mycomponent/images/s_clientadverts.png" alt="Mycomponent/Categories">COM_MYCOMPONENT_ADVERTS_ADVERT_TYPE</menu>
    </submenu>

Cheers Glenn

  • Yep. All of my components have the admin and submenu elements defined in the manifest. – Terry Carter Oct 9 '17 at 0:06
  • This method works if you re-zip and reinstall your extension I found out well after the fact. – Terry Carter Dec 27 '17 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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