Reputation: 11
I am working with joomla 1.7.I want to extend registration fields or add custom fields without modifying core files. In future i will be upgrade to new version, it's not affect the changes. can anyone please help me?
Upvotes: 1
Views: 3554
Reputation: 11
You may use a copy of the core files you need to hack and save them to your template. That is nothing else but the famous "template overrides". When you do it, you don't loose your hacks when you upgrade Joomla. Have a look at http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core and at http://docs.joomla.org/Understanding_Output_Overrides. Hope it's helpfull.
Upvotes: 1
Reputation: 399
VERY SIMPLY:
Activate the built-in 'User - Profile' plugin and configure (J1.6+ only). This adds lots of extra fields to the registration form and user profiles. You may need to modify the language file for the plugin to change some of the field names to suite.
Upvotes: 2
Reputation: 21
If you want to save the new data to the users table, it's easy:
Edit administrator/components/com_users/models/forms/user.xml
and add your new fields, then modify the database so that the users table can accept the new data. That's it.
Customized registration is more difficult. As a starting point, create a plugin and look up the "onUser" functions.
Load the plugin by going to (administrator)->Extensions->Manage->install
from directory , then activate it by going to (administrator)->Extensions->Plugins->(choose yours)->Enable
Use onUserAfterSave()
to save information, and onContentPrepareData()
to load it. For example: onContentPrepareData
would set $data->yourNewField
, and onUserAfterSave
would get $user['yourNewField']
and store it to a database (or whatnot).
Upvotes: 0
Reputation: 886
It's not too hard - and there's no need to hack the core. One of the really cool things about 1.6+ is that extending the registration fields is relatively easy.
Here's one source: http://www.joellipman.com/articles/web-development/joomla-cms/28-tutorials/499-creating-a-profile-plugin-for-joomla-16.html
Another way (which is sort of the same) is to go into plugins/user. In there should be a folder called "profile"
One caveat - what doesn't seem to be working with this method is a way of forcing a particular field to be required. There is a patch in joomlacode but I couldn't get it working and many others seemed to have problems too (though others say it worked fine).
Upvotes: 1
Reputation: 2777
I haven't used this extension, but it looks like it will extend your registration and allow custom fields without modifying joomla core files.
It is also compatible with Joomla 1.7 and 2.5 so you will have no trouble upgrading.
http://extensions.joomla.org/extensions/access-a-security/site-access/authentication/14303
Upvotes: 0
Reputation: 130
This is one of those questions a lot of people ask about Joomla. Extending the registration fields is not a simple thing. You could hack the core code, but that's not a great idea.
There are extensions in the Jomla Extension Directory that can help you. Another way to go is to install Seblod, a CCK which which allows you to extend all fields/forms in Joomla (http://www.seblod.com).
Upvotes: 0