2

I'm writing a component that will rely on Joomla's Categories to manage its own categories.

Everything's working OK, I just cannot figure out how to change my component's Categories list title.

I'd like to show "My Component Name or whatever: Categories" on the top title bar just like it happens with Articles and Banners Categories.

Thanks a lot!

Custom Component categories

2 Answers 2

2

I found the solution.

We must not use the string COM_MYCOMPONENT = "My component", as per the "component name", but the "extension name" as is shown on the url.

Given:

/administrator/index.php?option=com_categories&extension=com_mycomponent.somecategorytype

The language string must be COM_MYCOMPONENT_SOMECATEGORYTYPE on administrator/language/en-GB/com_mycomponent.ini

Thanks @Zollie and @Sharky for the tips.

1

You need to add a certain language string to the admin language file of your component. The most basic is simply the name of the component, for example COM_CONTENT. So in the language file you would add:

COM_CONTENT="Articles"

If you're using category sections in your component, append the section, e.g. COM_CONTENT_ARTICLES. You can optionally append _CATEGORIES_TITLE suffix to allow different string specifically in this view, since the generic ones are used in many other places where content types are needed. So COM_CONTENT_CATEGORIES_TITLE or COM_CONTENT_ARTICLES_CATEGORIES_TITLE also work.

2
  • I'm sorry, but I cannot get that to work. Following your tip, I even searched com_banners.ini and com_banners.sys.ini for a string for "Banners: Categories", and could not identify it. Can you please point how is that made on com_banners? (it's probably less confusing than com_content) Thanks. Apr 9, 2023 at 17:41
  • @AlexandrePaulo - what @Sharky is saying is when you place a language string into your administrator/language -> en-GB -> com_mycomponent.ini file for example: COM_MYCOMPONENT="My Component" then the com_categories extension automatically will take that string and add it before the word Categories and you'll get the title you are looking for.
    – Zollie
    Apr 11, 2023 at 16:11

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.