How to create a custom form field type in Joomla?

How to create a custom form field type in Joomla?

For a full list, see Standard form field types. Joomla! makes it possible to extend standard field types or define your own. For example, if your component manages phone book entries, you might want to define a form field type that outputs a select list of cities. There are several advantages to defining a custom form field type:

How to subclass an existing type in Joomla?

To subclass an existing type, for example JFormFieldList, load it by adding the following after jimport (‘joomla.form.formfield’);: If your form field type is unlike any existing type, subclass JFormField directly. The standard form field types are located in libraries/joomla/form/fields/.

What are the advanced features of Joomla form API?

This guide describes more advanced features of the Joomla Form API than is covered in Basic form guide, and comprises the following aspects: setting the file Path to enable Joomla to find your definitions of your form, your form fields and your form field validation, in the case where you don’t follow the Joomla standards.

How is the HTML value treated in Joomla?

The HTML value attribute is treated somewhat differently from other HTML attributes. As outlined in the Basic form guide, in the Joomla Form instance the XML form structure (defined by the form definition XML file) is held separately from the form pre-fill data (passed in the bind () method).

How to get an array of fields in Joomla?

Method to get an array of elements from the form XML document which are in a control group by name. mixed The optional dot-separated form group path on which to find the fields. Null will return all fields. False will return fields not in a group.

How to bind data to form in Joomla?

Method to bind data to the form. mixed An array or object of data to bind to the form. boolean True on success. Method to bind data to the form for the group level. string The dot-separated form group path on which to bind the data. mixed An array or object of data to bind to the form for the group level. Method to filter the form data.

How to use article field extension in Joomla?

With great capabilities, the Article Field extension allows you to link one article from a list and then link to other articles, which you can not do with the native Joomla custom field. Moreover, you can determine which articles show up in the custom field by optionally filtering them by categories. 2. CFI

Where are the categories stored in Joomla component?

The categories are stored in the #__categories table, which is “partitioned” by component, via the extension column which denotes the component to which the category belongs. In the same way we add into the sidebar submenu a link to the functionality for managing custom Fields, and one for custom Field Groups.