Adding Custom User Profile Fields in Joomla 2.5 - Step 2/3 - The Front End Form
Joomla 2.5 has reached its end of life as for 12/31/2014. Please be advised this may be a security risk to your website. You can view more information about the end of life here.
If you're following our tutorial on adding custom fields to the Joomla 2.5 User Profile plugin, our next step is to edit the front-end form so the user can enter a value for the new field. The new field we're adding is a text field where users can type in the name of their favorite baseball team.
To edit the user profile form on the front end, you'll need to edit the following file:
You can look at the other code in the profile10/profiles/profile.xml file as an example, and in our testing at line 94 we added the following code:
<field name="baseballteam" type="text" id="baseballteam" description="Favorite Baseball Team Description Goes Here" filter="string" label="Favorite BaseBall Team" message="PLG_USER_PROFILE_FIELD_WEB_SITE_MESSAGE" size="30" />
As you can see, the name of our variable is baseballteam. The label is Favorite BaseBall Team, and the description is Favorite Baseball Team Description Goes Here.
You can see in the screenshot below how this new code affects our user facing user profile page:
|Viewing your profile||Editing your profile|
Our next step is to update our plugin's XML file so that Site Administrators have the option to toggle on/off whether this new user field will be required or not.
‹Section 5: Adding Custom User Profile Fields in Joomla 2.5 - Step 1/3 - Copy the Plugin
›Section 7: Adding Custom User Profile Fields in Joomla 2.5 - Step 3/3 - Plugin Parameters
Joomla Community Google+ Hangout #3
June 3rd, 2014
Thank you @RustyJoomla for letting me speak on the Joomla Community Google+ Hangout!
Support Center LoginOur Login page has moved, Click the button below to be taken to the login page.
Social Media Login
Joomla 2.5 User Profile Plugin
2015-04-20 7:29 pm
Can you store the Custom User Profile Fields in a "custom" database table? What modifications would be needed to make that work?
2014-03-12 6:52 am
If I want to add image filed for the picture of user like k2.
what sould I do?