User Meta Plugin Extends Joomla's User Fields |
| September 17, 2010 |
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![]() Go to Joomlacode.org and download the User Meta plugin. Upload User Meta![]() 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![]() 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": ![]() Add Your Own Fields![]() 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: ![]() Adding the Fields to Your Site's Registration![]() 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: ![]()
Remember Not to Hack Core FilesIf 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_content/register/default.php |
Open Source Training is not affiliated with or endorsed by the Joomla, WordPress or Drupal projects.
All product names and trademarks are the property of their respective owners.
Copyright © 2012 Open Source Training, LLC. All rights reserved.
Comments
Two choices:
1) You'd need to also edit the administrator display files, perhaps for com_user
2) You can access the information from the database in the _users table and the params field.
thank you.
Welcome to OsTraining :-)
Here you go:
joomlacode.org/.../frs
Kind regards,
Nick
Unfortunately the developer has only made it available for 1.5. You could port it yourself though since it's Open Source. Alternatively there are other extensions that you can use to get user data that are available for 1.7
Kind regards,
Nick
RSS feed for comments to this post