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:

/plugins/user/profile10/profiles/profile.xml

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
viewing-the-form 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.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Joomla Community Google+ Hangout #3

June 3rd, 2014

Thank you @RustyJoomla for letting me speak on the Joomla Community Google+ Hangout!

Click here to watch!

2014-03-12 6:52 am
Hi
If I want to add image filed for the picture of user like k2.
what sould I do?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

1 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!