fb pixel
Skip to main content
Login

New to DJ-Extensions?
23 November, 2023
Follow Us

How to use custom fields in Joomla 4?

23 November, 2023

Custom fields in Joomla 4 are a powerful feature that allows users to tailor and extend their content with specific data fields. Unlike traditional content management systems, Joomla's custom fields provide a flexible and intuitive way to gather and display information beyond the standard article parameters.

There are 17 types of custom fields which can be added:

  • calendar

  • checkboxes

  • colour

  • DJ-MediaTools album

  • editor

  • integer

  • list

  • list of images

  • media

  • radio

  • SQL

  • subform

  • text

  • text area

  • URL

  • user

  • user groups

Each field can be highly customized and used in:

  • articles

  • users profiles

  • contact forms

Of course, many of the developers probably will also start to integrate custom fields in 3rd party components.

Our components integrate with custom fields:

How to create a custom field in Joomla? Let's do an example!

Under Content menu in the backend, you can find two positions: Fields and Field Groups.

joomla 4 custom fields view

First, you need to create a group for your custom fields, click a +New button.

joomla 4 create new field groups
joomla 4 create new field groups

Then in Content - Fields, you can create fields

General field settings

joomla 4 custom fields general filed settings

Options for custom field

joomla 4 custom fields options for custom field

Form Options

Display Options

After Title - field will be visible below the article title. Example:

joomla 4 custom fields after title field example in article

Before Display - field will be displayed before the article content:

joomla 4 custom fields before display field example in article

After Display - field will be displayed below the article content:

joomla 4 custom fields after display field example in article

No - field will not be displayed by default, but you can display it manually in the article:

joomla 4 custom fields in article add field in article
joomla 4 custom fields in article add field in article
joomla 4 custom fields in article add field in article

Publishing

joomla 4 custom fields in articles publishing options

There is a possibility to assign fields to fields groups and categories. You can set the category to all or select some categories. These options give you the ability to create multiple groups and fields and display them in the specific places.

The example of filed groups:

joomla 4 custom fields in articles field groups example view

The example of custom fields:

joomla 4 custom fields in articles fields example view

How to use Joomla custom fields in the article?

Once you have custom fields, we need to set a field data. Edit the article and find a tab with a Fields group name.

joomla 4 custom fields in articles adding fields in article

You can display each custom filed directly in the article content. Simply, click Fields button in the Editor and choose field or group in the modal popup.

joomla 4 custom fields in article addinf fields from button in the editor section

You can also use plain text to display fields or groups:

where '1' is an ID of field or group.

How to use Joomla custom fields in contacts or user profiles?

Basically, it is very similar to usage in the articles. The difference is that you should add custom fields and groups under Users:

joomla 4 custom fields in users
joomla 4 custom fields add new fields in users

or in Components - Contacts:

joomla 4 custom fields in contacts
joomla 4 custom fields add new fields in contacts

What is the purpose of custom fields on Joomla site?

You can prepare many cool things, below you will find an example of the car product.

Example field:

Brand (media)

joomla 4 custom fields in article add media type field

Condition (radio)

joomla 4 custom fields in articles select radio type filed

First registration (calendar)

joomla 4 custom fields in articles select calendar type field

Interior features (checkboxes)

joomla 4 custom fields in articles checkboxes type of fields example

Article settings:

joomla 4 custom fields in articles - article field settings

Result:

joomla 4 custom fields in articles - article field website view

Unlimited possibilities of Joomla custom fields?

Almost. Custom fields are really powerful but the most important thing is you can use them in your own way!
Overrides is the key. You can use custom fields in overridden files.

Good luck!