
Custom Fields in Joomla
Custom Fields turn Joomla from a basic content management system into a flexible content platform. They let you add structured data to articles, users, contacts, categories, and tags, without writing a single line of code.
This article explains how Joomla Custom Fields really work. It covers the basics for editors and administrators, the 18 core field types in Joomla 6, the rendering options for designers, and the developer hooks for building your own field types. You will also learn how the data is stored, how access control fits in, and how to avoid the most common mistakes.
Custom Fields is the flexible content-modelling layer of Joomla
The goal is simple: help you understand Custom Fields well enough to model your content with confidence.
1. The Basics
1.1 What is a Custom Field?
A Custom Field is an extra input - beyond title and body - that you can attach to a Joomla item. Each field has a type (text, list, image, date, and so on), a name, a label, and a small set of configuration options.
You can attach Custom Fields to:
- Articles (
com_content.article) - Categories (
com_content.categories) - Contacts (
com_contact.contact) - Users (
com_users.user) - Tags (
com_tags.tag) - Third-party components that opt in
The context string (component.view) is what binds a field to its target. The same field engine powers all of these targets.
1.2 What Problem Do They Solve?
Before Custom Fields, editors had three options to store extra data on an article:
- Build a custom component.
- Hide HTML inside the article body.
- Install a third-party content construction kit (CCK) like K2, Seblod, or Fabrik.
Since Joomla 3.7, the CMS ships this out of the box. No extra extension is needed.
Without Custom Fields, editors tend to:
- Cram everything into the article body.
- Misuse the intro text.
- Rely on copy-paste templates.
- Forget required information.
- Produce inconsistent content.
With Custom Fields, you gain structured data, predictable layouts, validation, per-category forms, and rendering without code.
1.3 Where Do I Find Custom Fields?
In the Joomla 6 backend, every supported component has its own set of fields and field groups:
Content → Fields (article fields)
Content → Field Groups (group fields together)
Components → Contacts → Fields (contact fields)
Users → Manage → Fields (user profile fields)
Components → Tags → Fields (tag fields)
1.4 The Four Concepts Behind Every Custom Field
Every Custom Field is defined by four decisions:
| Concept | Question it answers |
|---|---|
| Type | What kind of input is it? (Text, List, Media, Subform, and so on.) |
| Field Group | How is it grouped in the editor interface? |
| Category | Where does it appear? Which items show this field? |
| Access | Who can see and edit it? |
Get these four right and the rest is detail.
1.5 Field vs Field Group
It helps to keep two terms apart from the start:
| Concept | What it is |
|---|---|
| Field | A single input, for example "Phone number". |
| Field Group | A bundle of fields, rendered together as one block. |
Field Groups give you a shared heading, one template override per group, and a logical grouping in the editor interface.
2. Creating a Custom Field
2.1 The Minimum Steps
To create a new article field, go to:
Content → Fields → New
- Pick a Type (Text, List, Calendar, and so on).
- Set a Title, shown to editors.
- Set a Name, the machine name used in
and in template overrides. - Choose a Field Group (optional).
- Assign the field to one or more Categories, or to "All".
- Save.
The field now appears on every matching article's edit screen.
2.2 The Field Edit Screen
The edit screen is split into tabs. Each tab controls a different aspect of the field:
| Tab | What it controls |
|---|---|
| Field | Type, title, name, label, default value, description. |
| Options | Type-specific options like list values, minimum, maximum, format. |
| Assigned Categories | Which categories show this field. |
| Publishing | Status, access, language, created and modified info. |
| Permissions | Per-group ACL: edit value, edit field, edit state, delete. |
2.3 Key Field Settings
- Type: cannot be changed safely after saving once data exists.
- Name: used as the
shortcode key and in overrides. Lowercase, no spaces. - Label: displayed next to the input. Falls back to the Title if empty.
- Required: Joomla will refuse to save the item without a value.
- Default Value: pre-fills the input on new items.
- Filter: sanitisation rule (Text, Raw, HTML, Integer, and so on).
- Automatic Display: After Title, Before Display, After Display, or Do not automatically display.
3. The 18 Core Field Types in Joomla 6
Joomla 6 ships with 18 core field types, including two new ones: Number and Note. Each type is a plugin under plugins/fields/.
3.1 Basic Inputs
| Type | Purpose | Example |
|---|---|---|
| Text | Single-line text input | Subtitle, SKU, short code |
| Textarea | Multi-line text box | Short description, summary |
| Editor | WYSIWYG rich-text input | Author bio, extended description |
3.2 Choice Fields
| Type | Purpose | Example |
|---|---|---|
| Checkboxes | Multi-select from a fixed list | "Available features" on a product |
| Radio | Pick exactly one from a visible list | "Show sidebar?" Yes / No |
| List | Dropdown for single (or multiple) selection | Difficulty: Easy / Medium / Hard |
3.3 Media Fields
| Type | Purpose | Example |
|---|---|---|
| Imagelist | Pick an image from a specific folder | Select icon, choose banner |
| Media | Pick from the Media Manager | Product image, promo video, downloadable PDF |
The Media field uses Joomla 6's Media Manager modal, supports subfolders, and stores a path string.
3.4 Relational Fields
| Type | Purpose | Example |
|---|---|---|
| User | Link to a Joomla user account | Assigned author, account manager |
| User Groups | Pick one or more user groups | "Allowed roles" on an article |
| SQL | Dropdown populated by a SQL query | Connect an article to other articles |
3.5 Number Fields
| Type | Purpose | Example |
|---|---|---|
| Integer | Whole numbers only | Stock quantity, number of seats |
| Number (new in Joomla 6) | Numeric input with decimals | Price, weight, percentage |
Use Number instead of Integer whenever decimals matter. Before Joomla 6, you had to fake this with a Text field plus a filter.
3.6 Date, Colour, and URL
| Type | Purpose | Example |
|---|---|---|
| Calendar | Date or date-time picker | Event date, publication deadline |
| Colour | Hex colour picker | Brand colour per article or category |
| URL | Validated URL with optional target | Official website, booking page |
3.7 Helper and Structural Fields
| Type | Purpose | Example |
|---|---|---|
| Note (new in Joomla 6) | Non-editable note inside the admin form | Explain how to fill related fields |
| Subform | A mini form embedded in a field, repeatable | Team members, agenda items |
The Note field is purely instructional. It stores no value. It exists to help editors, not to capture data.
The Subform field is the workhorse for "one article has many of something". Its values are stored as JSON, which we will return to later.
3.8 The SQL Field
The SQL field renders a dropdown filled by a database query you write yourself. A typical query looks like this:
SELECT id AS value, title AS text
FROM `#__content`
WHERE catid IN (8) AND state = 1
ORDER BY title ASC;
The SQL field is powerful but risky:
- The query runs with site privileges on every form load.
- Only Super Users are allowed to create SQL fields.
- Never build the query from unfiltered user input.
If you only need a simple lookup, use a regular List field instead.
3.9 At-a-glance Summary
| # | Type | Category | New in Joomla 6? |
|---|---|---|---|
| 1 | Text | Basic | |
| 2 | Textarea | Basic | |
| 3 | Editor | Basic | |
| 4 | Checkboxes | Choice | |
| 5 | Radio | Choice | |
| 6 | List | Choice | |
| 7 | Imagelist | Media | |
| 8 | Media | Media | |
| 9 | User | Relational | |
| 10 | User Groups | Relational | |
| 11 | Integer | Number | |
| 12 | Number | Number | yes |
| 13 | Calendar | Date | |
| 14 | Colour | Visual | |
| 15 | URL | Web | |
| 16 | Note | Helper | yes |
| 17 | Subform | Structural | |
| 18 | SQL | Relational, advanced |
4. Assigning Fields to Categories
4.1 The Assigned Categories Tab
On every field you can pick one of two strategies:
- All categories: the field appears everywhere in that component.
- Specific categories: only on items in the selected categories.
This is how you give "Events" articles their start_date field without polluting "News" articles with it.
4.2 Content Types via Category
This pattern lets you build several "content types" inside one component:
Articles
├── News → fields: source, byline
├── Events → fields: start_date, location, ticket_url
└── Team members → fields: photo, role, bio_summary
One component, three content types, all driven by category-bound fields.
4.3 Inheritance and Defaults
- A field assigned to "All categories" applies everywhere in its component.
- A field assigned to specific categories applies only to those categories. It does not inherit to child categories.
- If you nest categories, assign the field to each level where it is needed.
5. Rendering Custom Fields
5.1 Automatic Display
The Automatic Display option places the rendered output in one of four positions:
- After Title: between the title and the intro text.
- Before Display Text: above the article body.
- After Display Text: below the article body.
- Do not automatically display: render it yourself.
A full Field Group renders together, as one block, in the defined order.
5.2 Manual Placement With Shortcodes
Inside the article body you can drop simple shortcodes:
→ renders field id 5 (label + value)
→ renders all fields in field group id 2
You can mix prose and field output:
Speaker:
Date:
5.3 Layout Overrides
Field rendering uses layouts under:
layouts/com_fields/
render.php (wrapper)
field/
render.php (single field row)
list.php (list field type)
media.php
subform.php
...
Override them in your template:
templates/your_template/html/layouts/com_fields/field/render.php
For a single field type, override the file named after that type (for example media.php). For a single named field, use:
render-<fieldname>.php
5.4 Where the Values Come From
When Joomla loads an article, it:
- Reads
#__fields_valuesfor that item id. - Joins
#__fieldsfor the metadata. - Filters by category assignment.
- Filters by access level and permissions.
- Renders the output through the layout chain.
6. Access Control (ACL)
6.1 Two Layers
Custom Fields use the same two ACL concepts as the rest of Joomla. They are not the same:
| Concept | Question it answers |
|---|---|
| Access | Who can see the rendered value on the frontend? |
| Permissions | Who can edit the field value in the backend? |
A field can be visible only to "Registered" users, while the article itself stays public.
6.2 Permissions on a Field
On the Permissions tab of a field you control these actions per user group:
| Action | Meaning |
|---|---|
| Edit Custom Field Value | Fill in or change this field on items. |
| Edit State | Publish or unpublish the field itself. |
| Edit | Edit the field definition. |
| Delete | Delete the field. |
Editors usually need only Edit Custom Field Value. They do not need access to the field definition.
6.3 The Inheritance Chain
The same Inherit / Allow / Deny rules apply as everywhere else in Joomla:
Global Configuration
└── Component (for example com_content)
└── Category (custom field rules)
└── Field
6.4 Practical Use Cases
- Hide an "internal note" field from everyone except editors.
- Show "Member price" only to Registered users.
- Allow shop managers to edit "Stock", but not "Public description".
7. The Subform Field
7.1 Why Use a Subform?
Use a Subform when one item has many of something, in a structured way:
- Sessions in a conference article.
- Speakers in an event.
- Downloads in a product page.
- FAQ entries in a help article.
Each row in a Subform is its own mini form, with its own inner fields.
7.2 How to Build One
- Create the inner fields first (Text, URL, Image, and so on).
- Create a Subform field.
- On the Options tab, pick the inner fields. Set Repeatable to Yes and define minimum and maximum rows.
- Assign the Subform to the right categories.
7.3 What Gets Stored
The Subform value is stored as JSON in #__fields_values.value:
[
{"speaker_name": "Ada", "speaker_role": "Keynote"},
{"speaker_name": "Tim", "speaker_role": "Workshop"}
]
This JSON drives both the editor interface and the rendered output.
7.4 Rendering a Subform
The Subform has its own layout file:
layouts/com_fields/field/subform.php
Override this file when you need full control over the loop, the markup, the CSS classes, and the per-row layout.
8. Custom Fields Beyond Articles
8.1 Users
Go to Users → Manage → Fields to add fields like "Phone", "Company", or "Newsletter opt-in".
User fields appear on three screens:
- The backend user edit screen.
- The frontend registration form, if the field is published.
- The frontend profile edit form.
8.2 Contacts
Go to Components → Contacts → Fields. Contact fields are useful for staff directories. Add fields like "Department", "Office hours", or "Photo".
8.3 Categories
Go to Content → Categories → Fields (context com_content.categories). These fields are stored against the category itself, not against any article. Typical uses:
- A "Header image" rendered on the Category Blog page.
- A "Subtitle" displayed under the category title.
- An "Intro CTA" specific to that category.
You render category fields inside a Category Blog template override.
8.4 Tags
Go to Components → Tags → Fields (context com_tags.tag). Tag fields are stored against the tag itself, for example a "Tag icon" or a "Tag colour" displayed on tagged-content listings.
8.5 Third-party Components
Any component can opt in to the Custom Fields system. It does this by:
- Declaring its own context, for example
com_yourcomponent.item. - Calling the fields plugin events on save, load, and display.
- Adding a
com_fieldsmenu hook in the sidebar.
Once that is done, the component gets the same field interface for free.
9. Under the Hood (Developer View)
9.1 The Four Database Tables
Custom Fields are stored in four core tables:
#__fields field definitions (name, type, params, ...)
#__fields_groups field group definitions
#__fields_values per-item values (item_id, field_id, value)
#__fields_categories field-to-category assignments
A value can be plain text, JSON (for a Subform), or any string the field type chooses.
9.2 Key Columns in #__fields
id
title
name (machine name, used in )
type (text, list, media, subform, ...)
context (com_content.article, com_users.user, ...)
group_id
state (1 published, 0 unpublished)
access
language
fieldparams (JSON: type-specific options)
params (JSON: display and behaviour)
9.3 Plugin Architecture
Custom Fields are plugins. Each field type lives in its own directory:
plugins/fields/<type>/
The core ships with: calendar, checkboxes, color, editor, imagelist, integer, list, media, note, number, radio, sql, subform, text, textarea, url, user, and usergrouplist.
A field-type plugin defines:
- How the input renders in the form (form XML).
- How the value renders on the frontend.
- Optional validation.
- Optional onSave and onPrepare logic.
9.4 Plugin Events
These are the seams for your own custom field type:
| Event | When it fires |
|---|---|
onContentPrepareForm |
Inject fields into the edit form. |
onContentPrepareData |
Load saved values into the form. |
onContentAfterSave |
Persist field values after the item is saved. |
onContentPrepare |
Render fields into the displayed content. |
onCustomFieldsPrepareDom |
Build the field's XML in the form. |
onCustomFieldsBeforePrepareField |
Tweak the value just before rendering. |
onCustomFieldsAfterPrepareField |
Tweak the value just after rendering. |
9.5 The PHP API
The modern, clean way to read fields from PHP:
use Joomla\Component\Fields\Administrator\Helper\FieldsHelper;
// All fields for an article, with values merged in
$fields = FieldsHelper::getFields(
'com_content.article',
$article, // the article object: gives item id + category id
true // prepare values for display
);
foreach ($fields as $field) {
echo $field->name . ' = ' . $field->rawvalue;
echo $field->value; // rendered HTML
}
A shorter legacy pattern still works inside content overrides:
echo $item->jcfields[3]->value; // by field id
Prefer FieldsHelper::getFields(). It survives field-id changes between sites and gives you the full metadata.
9.6 Headless Joomla: Fields Over the Web Services API
Joomla's Web Services API returns custom field values alongside the item:
GET /api/index.php/v1/content/articles/42
The JSON response includes a fields collection with id, name, type, raw value, and rendered value. This makes Joomla a viable headless backend for:
- Vue, React, or Svelte frontends.
- Static-site generators.
- Native mobile apps.
- AI and automation pipelines.
Only published fields that the API user can access are returned. ACL still applies over the API.
9.7 Building Your Own Field Type
- Create a plugin folder under
plugins/fields/myfield/. - Add a manifest XML and a main PHP class extending
FieldsPlugin. - Implement
getInputXml()for the editor input. - Implement
onCustomFieldsPrepareField()for the rendered output. - Install through Discover, or as a packaged zip.
- The new type now appears in the field-type dropdown.
10. Common Mistakes and Pitfalls
10.1 Changing Field Type After Data Exists
The value column is a single string. Switching from list to subform after editors have already filled in values usually leaves stale or unreadable data.
Pick the type carefully on day one. If you must change it, export the values, wipe them, and reimport.
10.2 Forgetting Category Assignment
A field with no assigned categories shows on no items. "All" is the safe default. You can always narrow it later.
10.3 SQL Fields and Security
The SQL field runs raw SQL on every form load:
- Only Super Users can create SQL fields.
- Never build the query from unfiltered user input.
- Prefer a List field with a manual lookup, or a custom plugin type.
10.4 Brittle Shortcodes
The shortcode references the field id, not the name. When you move a field between sites, the id changes and the shortcode breaks.
For portable content, prefer together with automatic placement.
10.5 Over-engineering
A Custom Field is not always the right answer:
- A one-off line of text belongs in the article body.
- Many fields, many rows, and many relations are a sign you need a real custom component.
10.6 Sloppy Machine Names
The name field is the machine identifier. It appears in overrides, shortcodes, and in the API. Treat it like a code identifier.
Good:
event_date
speaker_name
product_price
Avoid:
Field1
TestField
my new field
Use lowercase letters, underscore separators, and semantic names. Once a field is in use, renaming it breaks overrides and API consumers.
10.7 Other Gotchas
- Multilingual sites: the field language must match the item language, or be set to "All".
- Required fields on frontend forms: only enforced if the frontend form supports them.
- Caching: aggressive caches may serve stale field values after edits.
- Permissions confusion: denying "Edit Custom Field Value" at component level blocks every editor below.
11. Ecosystem and Extensions
11.1 Conditional Custom Fields
Conditional fields appear or disappear depending on the value of another field. This is native in Joomla 6 through plugin settings. A typical example is showing a "Ticket URL" field only when the "Has tickets" checkbox is on.
11.2 YOOtheme Pro
YOOtheme Pro is a popular page builder template that reads Joomla Custom Fields into its dynamic content system:
- Drop a custom field value into any builder element.
- Filter and sort dynamic lists by custom field values.
- Use the built-in Location field (latitude and longitude) on a map.
If your team already uses YOOtheme, you may never need to write a layout override for fields.
11.3 Advanced Custom Fields by Tassos
This third-party extension adds field types that core does not ship, plus richer rendering and conditional logic. It is useful when core's 18 types are not enough, but a full CCK would be overkill.
11.4 When to Reach for a CCK Instead
Custom Fields shine for content with extra attributes. For real database-driven applications (booking systems, real-estate listings with search facets, complex relations), consider:
- Seblod or Fabrik: full content construction kits.
- A custom component that plugs into
com_fields.
12. Best Practices and Quick Reference
If you only remember a few things from this article, remember these:
- Plan your fields and field groups before you start creating content.
- Choose the right type from day one. Changing the type later is painful.
- Use clear machine names like
event_date, neverField1. - Group related fields in Field Groups for a clean editor experience.
- Use the Number field (new in Joomla 6) for prices and percentages.
- Use the Note field (new in Joomla 6) to guide editors inside the form.
- Use Subforms for "one item has many of something" data.
- Set ACL at the field level only when needed. Inherit when possible.
- Override the layouts under
layouts/com_fields/field/for full control.
Cheat Sheet
CREATE FIELD Content → Fields → New
CREATE GROUP Content → Field Groups → New
ASSIGN Field → Assigned Categories tab
DISPLAY Field → Automatic Display setting
INLINE or in the body
OVERRIDE templates/{tpl}/html/layouts/com_fields/...
TYPE OVERRIDE render-<fieldname>.php for one field
USERS Users → Manage → Fields
CONTACTS Components → Contacts → Fields
CATEGORIES Content → Categories → Fields
TAGS Components → Tags → Fields
CORE TYPES 18 in Joomla 6 (Number + Note are new)
SUBFORM Repeating data, stored as JSON
SQL FIELD Super User only, handle with care
API FieldsHelper::getFields('com_content.article', $item)
HEADLESS /api/index.php/v1/content/articles/N → fields[]
TABLES #__fields / _groups / _values / _categories
13. Summary
Custom Fields turn Joomla from a basic CMS into a lightweight content modelling platform. They define:
- Structure: content with a predictable shape.
- Reusability: the same fields across many items.
- Per-category user experience: editors see only what they need.
- Rendering: automatic, shortcode, or full template override.
- Permissions: clear control over who edits and who sees what.
- Extensibility: your own field types through plugins.
- Integration: articles, users, contacts, tags, categories, and third-party components.
A well-designed set of Custom Fields makes a Joomla website easier to edit, easier to maintain, and easier to extend. Poorly named or badly assigned fields create problems that grow with the site.
If you are planning a new Joomla project, modelling a complex content type, or thinking about going headless, Custom Fields are one of the first places to look. They are a quiet but powerful part of what makes Joomla different from a one-shape-fits-all CMS.


Joomla en Linux specialist voor snelle, veilige en schaalbare websites.


