How to add custom fields to Joomla Articles
- by Editorial Staff
- on Tutorials
With the newest stable release of Joomla, version 3.7 a very welcomed feature is the addition of Custom Fields. In this tutorial we are going to discuss the basic functionalities of custom fields.
What are Joomla Custom Fields?
Joomla Custom Fields are a way to add arbitrary data to your articles, user profiles and contact forms. For example, if you are writing an article which is technically a recipe, you can create a field called “calories” and use it to store the total calories of the recipe you just wrote.
The anatomy of a Joomla Custom Field
A Joomla Custom Field is essentially a key/value pair. This means that first you need to create the key, for example “calories”, and then while writing the article you type in the calories.
It should be noted that the fields that have been created are available for every article, if they are meant for articles, or user profiles or contact forms if they are meant for those respectively. Whether you use them or not it’s up to you. At no circumstances would you need to create the field again.
Apart from the general nature of a custom field, the options for each custom field are many and they are categorized in Tabs as you can see in the screenshots below.
In the General Tab the most important field is the Type field where you can basically choose the functionality of the field. See the next section to see which types are available as of this moment.
In the Options Tab there isn’t a required field. It consists basically of options that would be used in a regular html form field.
In the Publishing Tab you can see the classic creation and modification information.
Finally, in the Permissions Tab you can see the classic permission settings which you can already set for the majority of Joomla’s components.
The available Custom Field Types
As we saw in the section above, you can create a field which has a certain type which in its turn defines its functionality. Joomla 3.7 packs an extensive list of Custom Field Types which you can see below.
- List of Images
- Text Area
- User Groups
It is worthy to mention that these fields can easily be extended because of their abstract nature and therefore there is a good chance the we will be seeing more of them by each release.
How to create a Joomla Custom Field?
Creating a new Joomla Custom Field is quite a simple process of filling out a group of forms.
To start creating a new Joomla Custom Field you need to navigate to your Joomla administration and then to Content > Fields.
Once you are there you will be greeted by all the tabs and options which we already saw in the Anatomy of a Custom Field section above.
As you can see, not all the options need to be filled out to end up with a new Joomla Custom Field. Just make sure that you fill out the required options marked by an asterisk and then proceed to fill out anything else that you might need
Furthermore, you can categorize your custom fields into field groups which visually helps you group them under explicit tabs in the article editing screen. However it is not mandatory to assign a custom field into a field group.
How to add a Custom Field to Joomla article?
Once you create your custom fields they will be available for editing through the article edit screen by default.
In our example we created a “Calories” custom field which we assigned to our new “Recipe fields” field group.
Also, any other custom field that you create which doesn’t belong to a field group, it will be available through the Fields Tab.
Useful Joomla Extensions
Since custom fields are still a very young feature of Joomla, there isn't a wide variety of extensions yet.
But, there is one up and coming extension called Advanced Custom Fields which already has a variety of UX and Media Custom Fields with the intention of keep adding new fields by each release.
Joomla Custom Fields are a very promising and very powerful feature which we believe that will propel Joomla to greater heights. Sign up to our Newsletter to stay in the loop about all the new and exciting Joomla features that are in the making!