0

I need to integrate a custom field in the user component of joomla core that allows me to list some data in a select, I get this data from an endpoint, and because this type of field does not exist between the predefined ones, I understand I must create a custom form field type. I am following this guide https://docs.joomla.org/Creating_a_custom_form_field_type. I have created a custom form field type in the location administrator/components/com_users/models/fields/cutsomfieldtype.php, the documentation mentions that in order to use the custom form field type I must update the xml file that contains the form fields definition, it also mentions that this xml should be located at administrator/components/com_users/models/form but in the com_user component I can't find this xml file, in this location there are many xml files but not one that defines the fields.

If I am misinterpreting this please let me know. I welcome your comments

1 Answer 1

2

The documentation you are following is for how to add a fieldtype to your OWN component not for changing a core component. If you did make your changes in the folders you have referenced then your changes will disappear during some future update to com_users.

I would suggest you start looking at the Joomla Custom Fields feature that is built in and allows you to add fields to core components that wont be over written during upgrades. Then if you can't find a field type to suit what you want then you can might find something on the JED, https://extensions.joomla.org/category/authoring-a-content/custom-fields/ to help you.

You might find this is a good primer to get you started with Joomla Custom Fields and it has a lot of links to other places for more information, https://magazine.joomla.org/issues/issue-apr-2018/item/3326-how-far-can-we-go-with-joomla-and-custom-fields

And this is a nice tutorial taking you through the steps to create your own field if you can't find anything to suit you already available, https://coolcat-creations.com/en/blog/tutorial-build-your-own-custom-field-plugin

Terry

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.