Component Development - Custom Admin Menu Link

by Terry Carter   Last Updated October 06, 2017 20:10 PM

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.

Tags : administrator


Answers 2


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

user1148731
user1148731
October 08, 2017 23:23 PM

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.

Richard B
Richard B
October 09, 2017 10:15 AM

Related Questions


Adding a popup to com_users in joomla

Updated February 29, 2016 01:04 AM

Backend user view own articles

Updated May 13, 2017 20:10 PM

Admin menu items disappearing

Updated August 03, 2015 14:04 PM