J5.x

J5.x:Adding custom fields

From Joomla! Documentation

Other languages:
Joomla! 
5.x
An Introduction to Adding and Managing Custom Fields


Introduction

Ever wanted to show additional attributes or information in an article, user form or contact pages? Through custom fields, you have a seamlessly integrated way to create and show a variety of content types on the Frontend of your website.

Custom fields offer 16 different types of output. As well as allowing additional information and attributes, they allow you to control where the content displays and control it's format. They can be used in a most simple way or to provide more complex functionality and layouts.

Joomla allows you to manage your Custom Fields by using Categories and Field Groups to control where and how they are available to use.

When you create Custom Fields they become available in the editor via an extra tab. Dependent on how you set them up they may appear via a Fields tab or a tab using a Field Group name. Additionally, the availability of the Custom Fields can be limited to a specific or multiple categories.

This is an introduction to a series of documents that covers adding custom fields for each of the core field types available.

How to access Custom Fields

You can create and manage Custom Fields through the sidebar menu and the relevant Component Dashboard.

For Custom Fields in an Article

From the sidebar menu click the Content down arrow to see the Fields and Field Groups links. Alternatively, clicking the grid icon at the side of the down arrow takes you to the Fields Dashboard where you will see the relevant links.

Access article fields via the sidebar menu

When adding Custom Fields for use in articles you have to set the view where the field will be used via a dropdown list beneath the New button.

  • Article - for the article view
  • Category - for use in a category blog view

For Custom Fields in a Contact

From the sidebar menu click the Component down arrow and then the Contact down arrow to see the Fields and Field Groups links. Alternatively, clicking the grid icon at the side of the down arrow takes you to the Contacts Dashboard where you will see the relevant links.

Access contact fields via the sidebar menu

When adding Custom Fields for the Contacts Component you have to set the view where the field will be used via a dropdown list beneath the New button.

  • Contact - for the contact view
  • Mail - for use in a contact form
  • Category - for use in a category view

For Custom Fields in a User

From the sidebar menu click the Users down arrow to see the Fields and Field Groups links. Alternatively, clicking the grid icon at the side of the down arrow takes you to the Fields Dashboard where you will see the relevant links.

Access user fields via the sidebar menu

Accessing Fields to use them

Once you have set up Custom Fields they are available for use.

How they appear depends on whether you have used Field Groups or not. The following screenshot shows a tab for a Field Group named Accessories.

New Article Fields Group Tab

The following is an example where no Field Groups have not been used. In this case you will see a Fields tab.

New User Fields Tab

Can you search Custom Fields?

Short answer: Yes, you can.

What else is important?

By default, when you create Fields they are available in the relevant component's Add New interface as a new tab. If they do not appear, make sure you have set the item to the category or categories the Field was set to.

Note that is possible to disable options in article settings so make sure that in Article Options, under Editing Layout, that Article Options is set to Show.

Also note that a Custom Field will not show up in an article if it is empty.

If you use versioning for your articles, fields are not stored in different versions.