This content may be out-of-date

This book was written circa 2022, when Joomla 4 was still a new thing. It has not been updated for Joomla 5 and beyond, and it's no longer being worked on. You can usually find more up-to-date information in the official Joomla! Manual.

Changes to your XML manifest and forms

A lot of this integration is, in fact, smoke and mirrors. Users are taken to the core com_categories component to manage categories. com_categories uses a form in our component, in the file administrator/components/com_example/forms/category.xml where com_example is our component, to add sections to the category configuration beyond the standard Joomla stuff. The way Joomla's main menu works along with a small change in our XML manifest will make the user think they are still in our component while they are using Joomla's com_categories.

For the user to have a way to manage categories and maintain the illusion they remain in our extension you have to add the following code in your XML manifest under <extension>, <administration>, <submenu>:

<menu link="option=com_categories&amp;extension=com_example">JCATEGORIES</menu>

where com_example is the name of your component.

By default, you'll get a rather barren category edit page with just the bare minimum of information Joomla needs to store about a category (a title, alias and description are required — you can't hide them or remove them in any way). The basic tabs you get in the category editor are Category, Options, Publishing, Fields (if any custom Fields are set up for the category) and Permissions.

You can display additional tabs with component-specific configuration options by creating the file administrator/components/com_example/forms/category.xml where com_example is the name of your component. This is a regular Joomla XML form file. Just remember, every <fieldset> you add becomes a tab in the Category edit page. Neat, huh?