Adding additional fields
So far, our component is a bit useless, as it just has a single title field and doesn't really do a lot. We can make it a whole lot better by adding a few more fields to capture some more information.
Let's assume that we want to use the com_folio
extension to show off some of the work we have done recently for our clients. For each portfolio item, we want to show an image, company name, phone number, website link, and description about that item. We will also show a couple of standard Joomla! fields, such as category and status.
Adding fields to the model
Start out by editing the form XML file /administrator/components/com_folio/model/forms/folio.xml
, and add in the following new fields that are highlighted:
<?xml version="1.0" encoding="utf-8"?> <form> <fieldset> <field name="id" type="text" default="0" label="JGLOBAL_FIELD_ID_LABEL" readonly="true" class="readonly" description="JGLOBAL_FIELD_ID_DESC"/> <field name=...