LOGIC Library

This site is the Logic involvement in sharing expertise and skills acquired in daily work. The goal is to create a solid knowledge base and share best practices in software development and systems management.

More info about us can be found on logicsistemi.it.

Joomla! 3: how to add custom fields to user registration form

More than a year ago I wrote a tutorial that explained how to write a plugin to add fields to the Joomla! 2.5 user registration form.

A year later the Joomla! 3 version is widely used and it's time to update my tutorial to make it work with the new version.


What has changed

We are lucky. The plugin written for the 2.5 version works right with the new platform without any change!

In details:

  • The plugin events used in the previous tutorial, onContentPrepareData, onContentPrepareForm, onUserAfterSave and onUserAfterDelete are unchanged with the new version

  • The database table used to store this information, #__user_profiles, is unchanged

  • Joomla! objects and methods used haven't changed

So the easy way to create the new Joomla! 3 plugin is the following:

If you are a perfectionist

If you are writing your own plugin and you are using features that only Joomla! 3 supports, you have to modify the Joomla! version in the manifest file.

So open the testprofile.xml file and change the row

<extension version="2.5" type="plugin" group="user">

with the following

<extension version="3.0" type="plugin" group="user">

With 3.0 you will cover all Joomla! 3.x versions.

Enjoy it!


#1 Dennis 2013-12-10 08:15
Hey guys good post and useful for us
#2 web2sign 2014-02-07 07:32
Thanks for the plugin! It solve my problem
#3 Werni 2014-03-11 11:45
Super tool, just what I need.
New fields are automaticaly marked as 'required'. How may I have them 'not required'?
There may I change the size of a field?
Thanks for answers
#4 Joppo 2014-05-10 11:41

Great post, thnx (!)

For my application I want to register a new user with a new usergroup, where the name of the usergroup is in the submitted form; Any suggestions how to extend your plugin to do this? (I'm just a beginner with respect to Joomla coding)
thnx for the answers...
#5 Yiannis 2014-05-24 19:34
Not just this article but the whole series is the best joomla tutorial I 've ever read. Congratulations !!! Keep amazing us