# Adding Additional Fields to Admin Component

I'm using Joomla 3.9.1 and SP Simple Portfolio v1.6

I would like to add some additional fields to the SP Simple Portfolio component. Image of current fields (taken from Google);

How can I add another field named 'Year' for example beside 'URL'. Ideally I want to add a number of custom fields, but I can add the rest at a later date.

I've found the file administrator\components\com_spsimpleportfolio\models\forms\item.xml, and can add an additional input named 'Year'.

I've also added a new year column to the spsimpleportfolio_items database table.

All appears to be working well, I can see my new field in the admin area and populate with data. This is saved into my database when I save the form.

Is the correct way of doing things? What if I ever update the component, will I lose these changes?

Thanks in advance.

## 1 Answer

This is true, and if you want to create an installation package, you need to add the new field to the installation sql file as well.

Yes, if you updated the component, you will lose all the changes.

• Thanks for that. How can I avoid losing the changes after an update? – jonboy Jan 15 at 9:10
• This is not possible, if you need this component as it is now, you can fork it, or make another copy with another name. It is possible to keep changes over updates if the changes are made as overrides, but you are changing the core of the component, so you can't keep them after updates. – Mohamed Abdelaziz Jan 15 at 10:01
• It might be worthwhile contacting the developers to see if they'll consider adding custom fields to a future version of the extension. – Neil Robertson Feb 15 at 6:36