Skip to content
Tutorials Center
My learning

Topics

Lesson 13 of 37 ยท Articles and Categories

Custom Fields for Structured Content in Joomla

Add structured data to Joomla articles, contacts and users with custom fields: field types, groups, category assignment, display options and a runnable field renderer.

An article is not always just a title and a block of text. A recipe has ingredients and a cooking time; a product page has a price and a part number; a team page has a role and a phone number. Instead of forcing all of that into the text editor, Joomla lets you add custom fields to your content. Each field has a name, a type and a place on the page, and it is edited with a proper form control, so editors cannot forget the format.

Custom fields are part of the Joomla core for articles, contacts and users. The backend steps are described in words; the stand-ins build a tiny field engine so you can see how types, validation and rendering fit together.

Where fields live

Open Content > Fields to create and manage fields for articles. For contacts and users, use Components > Contacts > Fields and Users > Fields. Field Groups (for example under Content > Field Groups) bundle fields into tabs or panels in the edit form and on the frontend.

Create a field with New and fill in:

  • Title and Name (a unique machine name, such as cooking-time).
  • Type: the kind of input.
  • Field group: optional.
  • Label and Description: what editors see.
  • Required: whether it must be filled.
  • Default value.
  • Category assignment (articles): the field appears only for articles in the chosen categories, such as a Recipes category.
  • Access and Language.
  • Options: how the value is displayed on the page (see below).

Field types

Joomla includes many types out of the box.

Common field types

Text, Textarea, Editor Free text and rich text
Integer, Calendar Numbers and dates
List, Radio, Checkboxes Fixed choices
Media, URL, Color Files, links, color pickers

Also: User, SQL, Subform, Image List

1 / 2
  • Text, Textarea and Editor for plain and rich text.
  • Integer for numbers within a range and step.
  • Calendar for dates.
  • List, Radio, Checkboxes for fixed options.
  • Color, URL, Media (image selection), Image List.
  • User and User Group to point to people.
  • SQL: a list filled by a database query.
  • Subform (also called Repeatable): a group of fields that can repeat, ideal for ingredients or price tiers.

Choose the most specific type: a Calendar validates a date; a text field accepts anything. Structured input means cleaner output and easier filtering later.

Showing fields

Fields appear automatically in the article, in a position you choose in the field's Options:

  • Automatic Display: After Title, Before Display, After Display or Do not automatically display.
  • Layout (when you want a custom look), label class and value class for styling.
  • Display in which views (for example full article and blog lists).

If you turn automatic display off, you can place the field with a shortcode in the article text, such as {field cooking-time} or {field 7} (by ID), or print it from a template override. The Fields - System plugin handles the substitution, so make sure it is enabled.

flowchart LR
    A["Editor fills fields<br/>in the article form"] --> B["Values stored with the article"]
    B --> C["Joomla renders each field<br/>using its type and options"]
    C --> D["Shown after title,<br/>before or after content"]

From the edit form to the page.

A tiny field engine

The stand-in below defines field definitions as data, validates values by type, and renders them as HTML, mirroring what Joomla's fields plugins do. It is not Joomla's code.

JS Stand-in: validate and render fields

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The first call lists three problems at once; the second prints an empty list and then the rendered fields. Note that every value is treated as text first and converted by the validator, as it is in an HTML form.

Per-category fields

A field assigned to certain categories appears only in articles of those categories. This keeps the form uncluttered: recipe fields appear for recipes and nothing else. The stand-in below filters the field list the same way.

JS Stand-in: fields by category

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Joomla reloads the form when the category changes, so new fields appear after you choose the category.

Fields beyond articles

  • Contact fields extend the contact form and page (department, opening hours).
  • User fields are shown on the registration and profile forms, useful for member sites (company, birth year).
  • Values are stored in the #__fields_values table, one row per item and field.

Good practice

  • Plan before you build. Write down the structured data you need.
  • Use names with lowercase and hyphens and never rename them after launch, because shortcodes and templates use them.
  • Prefer fields over HTML tables in article text; structured data can be shown in several layouts.
  • Keep required fields few. Too many mandatory fields frustrate editors.
  • Back up before deleting a field: its values are removed with it.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Where do you manage custom fields for articles?

    Article fields live under Content > Fields. Contacts and users have their own Fields screens.
  2. 2. Which field type suits a repeating list of ingredients?

    A subform repeats a group of fields, ideal for rows of similar data.
  3. 3. How can you show a field inside the article text?

    The Fields - System plugin replaces shortcodes with the rendered field.
  4. 4. What does assigning a field to a category do?

    Category assignment keeps edit forms focused on relevant fields.

Summary

  • Custom fields add structured data to articles, contacts and users without extensions.
  • Pick the most specific type: integer, calendar, list, media, subform and more.
  • Field groups organize the form; category assignment limits where a field appears.
  • Fields display automatically or through shortcodes and template overrides.
  • Choose stable lowercase names and plan the data first.

Next: The Editor, Media Manager and Text Filters