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.
Under Content menu in the backend, you can find two positions: Fields and Field Groups.
First, you need to create a group for your custom fields, click a +New button.
Then in Content - Fields, you can create fields
Title: Set a field title.
Type: Choose one of 17 available field types.
Name and Label: You can add them otherwise they will be automatically generated (from the title).
Description: Enter a custom field description.
Required: You can choose that field should be required or not.
Default Value: You can set a default value e.g. 'sample text' words for input.
Filter: You can control field content with a filter. For example, you can force to use only numbers (integer) in a given field. Some of the available options: raw, safe HTML, text, alphanumeric, integer, float, telephone.
Maximum Length: Define a maximum length of the input.
Placeholder: Set input placeholder. The attribute specifies a hint that describes the expected value of the field. For example a sample value or a short description of the expected format in this field. This hint is visible in the input before the user enters a value.
Field Class: You can set CSS classes which will be added to the fields in output or edit form.
Label Class (Form): Assign a class to the label.
Editable In: Choose: Site / Administrator / Both
Showon Attribute: Conditionally show or hide the field depending on the value of other fields.
Display Class: The class of the field container in the output.
Value Class: The class of the field value in the output.
Label: Choose Show / Hide
Label Class (Output): Add label class value
Automatic Display: After Title / Before Display Content / After Display Content / Do not automatically display
Prefix
Suffix
Layout
Display When Read-Only: Inherit / Yes / No
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:
The example of custom fields:
Once you have custom fields, we need to set a field data. Edit the article and find a tab with a Fields group name.
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.
You can also use plain text to display fields or groups:
where '1' is an ID of field or group.
Basically, it is very similar to usage in the articles. The difference is that you should add custom fields and groups under Users:
or in Components - Contacts:
You can prepare many cool things, below you will find an example of the car product.
Example field:
Result:
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!
Paddle checkout supporting credit cards and PayPal online payments.
All products purchased on our site are refundable.
Dedicated ticket system for all subscribers.