Focus on Joomla Categories: From Basics to Developer Hooks
Categories are one of the most important building blocks in Joomla. They look simple in the backend, but they touch almost every part of the system: content organisation, navigation, URLs, permissions, templates, and even custom extensions.
This article explains how Joomla categories really work. It covers the basics for website owners and editors, the practical setup for administrators, and the technical details for developers. You will learn how to create categories, how nesting works under the hood, how Access Control fits in, and how to avoid the most common mistakes.
The goal is simple: help you understand Joomla categories well enough to use them with confidence.
1. The Basics
1.1 What is a Category?
A category is a container used to group and organise content in Joomla. You can think of it as a smart folder for items.
Categories serve two main groups of people:
- They help editors organise content in a logical way.
- They help visitors browse related content easily.
1.2 Categories Are Everywhere
Categories are not only used for articles. Most core Joomla components use them:
- Articles:
com_content - Contacts:
com_contact - Newsfeeds:
com_newsfeeds - Banners:
com_banners
Many third-party extensions also use the same category system. This means once you understand categories, you understand a large part of how Joomla works.
1.3 Why Use Categories?
Categories solve several practical problems at once:
| Purpose | Example |
|---|---|
| Organisation | Group "News" articles separately from "Events". |
| Navigation | Build menu items like "Category Blog" or "Category List". |
| Access Control | Restrict a category to "Registered users" only. |
| Styling | Apply different layouts or templates per category. |
| URL structure | Get clean URLs like /news/joomla-6-released instead of /article/42. |
1.4 Where Do I Find Categories?
In the Joomla 6 backend, you can manage categories from several places:
System → Manage → Categories (global view)
Content → Articles → Categories (article categories)
Components → Contacts → Categories (contact categories)
Components → Banners → Categories (banner categories)
Each component shows only the categories that belong to it, but in the background they all live in the same database table. We will come back to that later.
2. Creating and Managing Categories
2.1 Creating a Category
To create a new article category, go to:
Content → Articles → Categories → New
Two fields are required:
- Title: the human-readable name shown in lists and menus.
- Alias: the short name used in the URL. Joomla can generate this for you from the title.
2.2 The Category Edit Screen
The edit screen is split into tabs. Each tab controls a different aspect of the category:
| Tab | What it controls |
|---|---|
| Category | Title, parent, status, access, language, description. |
| Options | Layout overrides, alternative layout, image. |
| Publishing | Created and modified dates, author, meta info, version note. |
| Permissions | Per-group ACL: create, delete, edit, edit state, edit own. |
2.3 Key Fields Explained
- Parent: leave empty for a top-level category, or pick another category to nest inside.
- Status: Published, Unpublished, Archived, or Trashed.
- Access: Public, Guest, Registered, Special, Super Users, or your own custom level.
- Language: bind the category to a specific site language, or leave it as "All".
- Note: an internal label, only visible in the backend.
- Version Note: a short message saved in the version history when you save the category.
3. Nested Categories
3.1 The Tree Structure
Joomla allows you to nest categories inside other categories. The result is a tree:
ROOT
├── News
│ ├── National
│ └── International
├── Events
│ ├── Workshops
│ └── Meetups
└── About
Behind the scenes, Joomla stores this tree using a technique called the Nested Set Model. Every category has two extra values: lft (left) and rgt (right). These values make deeply nested queries very fast.
3.2 How lft and rgt Actually Work
Take this small tree:
News
├── Company News
└── Joomla News
├── Extensions
└── Templates
Joomla stores it like this:
News lft=1 rgt=10
Company News lft=2 rgt=3
Joomla News lft=4 rgt=9
Extensions lft=5 rgt=6
Templates lft=7 rgt=8
The rule is simple: a parent always wraps its children. The parent's lft is smaller than every child's lft, and the parent's rgt is larger than every child's rgt.
3.3 Reading the Tree
A category is inside another category when:
child.lft > parent.lft
AND child.rgt < parent.rgt
For example, "Extensions" (5, 6) is inside "Joomla News" (4, 9) because 5 > 4 and 6 < 9.
3.4 Why This Matters
To get all child categories of "Joomla News", Joomla only needs one query:
SELECT *
FROM #__categories
WHERE lft > 4 AND rgt < 9
ORDER BY lft;
This returns "Extensions" and "Templates" without any recursion. Even on a huge tree, the read is fast.
3.5 When the Tree Breaks
The lft and rgt values must stay consistent. The tree can break when:
- Categories are edited directly in the database.
- A migration goes wrong.
- A custom extension inserts categories incorrectly.
- Parent-child relations change without updating the nested set values.
- A failed save leaves gaps or duplicate values.
Typical symptoms are: wrong ordering, missing children, or save errors in the backend.
3.6 The Rebuild Button
The Categories screen has a Rebuild button in the toolbar. It recalculates the values:
lft, rgt, level, path
Use Rebuild when:
- The ordering looks wrong.
- Categories vanish from their expected parent.
- You just finished a migration.
- You made raw SQL changes.
- Joomla reports tree errors.
Rebuild is a repair tool, not a substitute for correct extension code. Extensions should always use Joomla's APIs instead of raw SQL inserts.
3.7 Practical Rules
- A child category does not automatically inherit articles from its parent.
- Permissions are inherited from the parent unless you override them.
- Moving a category moves all its children with it.
- Keep the tree shallow - two or three levels is usually enough. Use Tags for cross-cutting topics.
4. Real-world Examples
The right category structure depends on the type of website. Here are three common patterns.
4.1 News Website
News
├── Politics
├── Sports
├── Tech
└── Culture
4.2 University Website
Departments
├── Engineering
├── Medicine
└── Law
4.3 Webshop
Products
├── Laptops
├── Phones
└── Accessories
The key idea is the same in all three cases: the category tree mirrors how visitors think about the content.
5. Categories on the Frontend
5.1 Menu Item Types
Joomla provides several menu item types that work with categories:
| Menu Item Type | What it shows |
|---|---|
| Category Blog | Articles from a category in a blog layout. |
| Category List | Articles from a category in a sortable, paginated table. |
| List All Categories | A tree with all categories from a chosen root. |
| Single Article | One article,related, but not strictly a category view. |
5.2 Layout Options for Category Blog
The Category Blog menu item is the most flexible. You can configure:
- Leading articles shown at full width.
- Intro articles arranged in one to six columns.
- Links (titles only) for older content.
- Pagination, ordering, and filters per category.
5.3 URL and Routing
With SEF URLs enabled, Joomla creates clean URLs based on the category tree:
/news → category root
/news/national → child category
/news/national/election-2026 → article inside the child
Joomla 6's router builds these nested category paths automatically, as long as the aliases are unique within the same parent.
6. Access Control (ACL)
6.1 Two Distinct Concepts
People often confuse two different ACL concepts in Joomla. They are not the same:
| Concept | Question it answers |
|---|---|
| Access (Viewing Access Level) | Who can see this? |
| Permissions (Actions) | Who can do what with this? |
6.2 Access Levels
You set the access level on the Category tab. The category and its articles are only visible to users who belong to the matching access level.
Joomla includes these built-in access levels:
- Public
- Guest
- Registered
- Special
- Super Users
You can also define your own access levels for situations such as paid memberships or staff-only areas.
6.3 Permissions per User Group
On the Permissions tab, you control what each user group can do inside the category:
| Action | Meaning |
|---|---|
| Create | Create new items in this category. |
| Delete | Delete items in this category. |
| Edit | Edit any item. |
| Edit State | Publish, unpublish, archive, or trash items. |
| Edit Own | Edit only items the user created. |
| Edit Custom Field Value | Change custom field values. |
6.4 The Inheritance Chain
Permissions flow from top to bottom:
Global Configuration
└── Component (for example com_content)
└── Category
└── Article
At each level, you can set a permission to:
- Inherit: the default, takes the value from the parent.
- Allowed: grants the permission.
- Denied: a hard block. You cannot override it at a lower level.
A practical rule of thumb: Deny at the highest level you can; allow at the lowest level you must.
6.5 Real-world ACL Examples
- Client portals where each client only sees their own documents.
- Staff-only documentation hidden from the public.
- Paid memberships with premium content.
- Department-only intranet sections.
7. Advanced Features
7.1 Custom Fields per Category
Joomla lets you attach Custom Fields to specific categories. Go to Content → Fields and Field Groups to set them up.
- Assign fields to specific categories so editors only see the inputs they need.
- Use the subform field type when you need repeating data structures.
- Render the values with
shortcodes or inside template overrides.
7.2 Layout Overrides per Category
You can customise the look of category views in your template:
templates/your_template/html/com_content/category/
blog.php
blog_item.php
blog_links.php
For a single category, set an Alternative Layout on the Options tab, or name your override file with the category alias for finer control.
7.3 Module Assignment by Category
Modules in Joomla are assigned to menu items, not directly to categories. To show a module on category pages, link a menu item to the category view and assign the module to that menu item.
7.4 Workflows in com_content
Workflows can be enabled per category. Articles then move through stages such as Draft, Review, and Published. Transitions between stages are controlled by ACL.
Go to Content → Workflows to define a workflow, then bind it to a category through the article options.
7.5 Tags vs Categories
Categories and Tags look similar but solve different problems:
| Use a Category when… | Use a Tag when… |
|---|---|
| An item belongs to one place. | An item relates to many topics. |
| Hierarchy matters. | You only need flat, cross-cutting labels. |
| You need ACL or workflow. | You want discovery and filtering. |
| The URL should reflect the structure. | The URL is not critical. |
A short way to remember the difference:
Categories define what content is.
Tags describe what content is about.
8. Under the Hood (Developer View)
8.1 One Database Table for All Extensions
Every category in Joomla lives in the same table:
jos_categories
├── com_content categories
├── com_contact categories
├── com_newsfeeds categories
└── com_example categories
The extension column tells Joomla which component a category belongs to.
8.2 Reusing com_categories in Your Extension
Any extension can reuse Joomla's built-in category manager. You only need to pass the right extension name in the URL:
/administrator/index.php?option=com_categories&view=categories&extension=com_messages
The important part is:
extension=com_messages
This tells Joomla: "Show categories that belong to this extension." You do not need to build your own category manager.
8.3 What You Get for Free
By reusing com_categories, your extension immediately gets:
- Nested category support.
- ACL integration.
- Published and unpublished states.
- Metadata fields.
- Language support.
- Ordering.
- Rebuild tooling.
8.4 Important Table Fields
The most important columns in #__categories are:
id
parent_id
level
path
extension
lft
rgt
alias
published
access
language
params (JSON blob with category-specific options)
metadata, metadesc, metakey (SEO)
The fields parent_id, level, lft, rgt, and path together describe the tree.
8.5 Categories API in PHP
From PHP you can work with categories through a clean API:
use Joomla\CMS\Categories\Categories;
$categories = Categories::getInstance('Content');
$node = $categories->get('news'); // by alias or id
$children = $node->getChildren();
$parent = $node->getParent();
$articles = $node->getNumItems();
8.6 Making Your Component Category-aware
For a custom component, follow these four steps:
- Use
extension = com_yourcomponentin#__categories. - Extend
Joomla\CMS\Categories\Categoriesfor your component. - Add a
rulescolumn to your items table for per-item ACL. - Register a router that handles category segments in the URL.
8.7 Events to Hook Into
Plugins can react to category events:
| Event | When it fires |
|---|---|
onCategoryChangeState |
When a category is published or unpublished. |
onContentAfterSave (context com_categories.category) |
After a category is saved. |
onContentBeforeDelete |
Before a category is deleted. |
9. Common Mistakes and Pitfalls
9.1 Too Many Top-level Categories
A common mistake is to create many top-level categories instead of grouping them.
Less ideal:
News
Blog
Articles
Updates
Stories
Better:
Content
├── News
├── Blog
└── Updates
9.2 Using Categories Like Tags
Categories should be:
- Strategic
- Stable
- Structural
Do not create "one-off" categories for a single article. Use Tags for that instead.
9.3 Bad Planning
Restructuring categories after the website is live causes many problems:
- Broken URLs.
- SEO regressions.
- Navigation confusion.
- Permission tangles.
The lesson: plan your categories before you start building content.
9.4 Other Gotchas
- Forgetting to rebuild after manual database edits leaves broken
lftandrgtvalues. - Mixing languages: a category in
nl-NLwill not show items inen-GB. - Permission confusion: a "Denied" at component level cannot be overridden lower down.
- Deleting a parent reassigns its children to the grandparent - it does not delete them.
- Alias collisions under different parents are allowed, but they can confuse SEF URLs if the router is not configured well.
10. Best Practices and Quick Reference
If you only remember a few things from this article, remember these:
- Plan your category structure before you create content.
- Keep the tree shallow - two or three levels are usually enough.
- Use Categories for structure, Tags for topics.
- Set ACL at the level where it makes most sense, then let inheritance do the rest.
- Reuse
com_categoriesin your own extensions instead of building something new. - Run Rebuild after migrations or any direct database changes.
Cheat Sheet
CREATE Content → Articles → Categories → New
NEST Set the "Parent" field
PUBLISH Status: Published + Access: Public
RESTRICT Access: Registered (or custom level)
HIERARCHY Use Rebuild if the tree breaks
WORKFLOW Bind on the Options tab
FIELDS Assign Custom Fields to specific categories
OVERRIDE templates/{tpl}/html/com_content/category/
ROUTING Enable SEF, use unique aliases
ACL Component → Category → Article (inherited)
REUSE index.php?option=com_categories&extension=com_X
11. Summary
In Joomla, categories are not just containers for content. They influence almost every layer of the system:
- Structure: your information architecture.
- Navigation: the menus visitors use.
- Permissions: who sees and edits what.
- SEO: URL paths and topic clustering.
- Scalability: growth without rewrites.
- Developer integration: a shared API for every extension.
- User experience: for both editors and visitors.
A well-planned category tree saves time, prevents bugs, and makes a Joomla website easier to maintain for years. A bad category tree creates problems that grow with the website.
If you are planning a new Joomla site, migrating from an older version, or you suspect that your current category structure causes problems, it pays to look at categories early. They are the quiet foundation under almost everything Joomla does.

