User Meta Plugin Extends Joomla's User Fields

User Meta is a small plugin that allows you to collect extra information from your users.

Most solutions to this problem require you to install a large and complex extension. Although User Meta does require a little coding it is a small and lightweight solution. Here's how you use it.

Download User Meta

tutuploadstutuploadstutuploadsmedia_1284730825816.png

Go to Joomlacode.org and download the User Meta plugin.

Upload User Meta

tutuploadstutuploadstutuploadsmedia_1284730917614.png

In your Joomla site, go to Extensions >> Install/Uninstall and upload the User Meta plugin. Then go to Extensions >> Plugin Manager and enable the plugin.

Setting Up the User Fields

tutuploadstutuploadsmedia_1284734098149.png

Next, we'll go and set up our extra user fields. Open your file manager and browse to /plugins/system/usermeta/. Open the user.xml file.

What you'll see are the current parameters that users see. These are "Back-end Language", "Front-end Language", "WYSYWYG Editor for this User", "Help Site for this User" and "Time Zone for this User":

tutuploadstutuploadsmedia_1284734156732.png

Add Your Own Fields

tutuploadstutuploadsmedia_1284734376785.png

You can create your own parameters in here using Joomla's default system. It's the same plugin language used for all templates and extensions. I've chosen to use a radio button for this example, hence type="radio".

If you have any predefined choices you can save them using options as in the example above. When you save your user.xml file, go and login to the front of your site and visit the normal Joomla user account page. It should look like the image below:

tutuploadstutuploadstutuploadsmedia_1284732564632.png

Adding the Fields to Your Site's Registration

tutuploadstutuploadstutuploadsmedia_1284732447739.png

You can also add these fields to any Joomla layout page. However, it makes sense to add it to the registration form so you can collect this information when people join. All you need to do is insert: {UserMeta}. In order to use it in the registration form, I've edited /components/com_user/views/register/tmpl/default.php. The result is shown below:

tutuploadstutuploadstutuploadsmedia_1284732616218.png

 

Remember Not to Hack Core Files

If you do use this last technique for your site's registration, rather than hack the core registration file, it's best to just override it. Copy the file from /components/com_user/views/register/tmpl/default.php to /templates/your-template-name/html/com_user/register/default.php