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.

Like this Article?

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

I'm Brad Markle, your friendly Community Support technician, and I wrote the article you're looking at now. I like to think it's perfect, but I'm sure you have some suggestions. Please, let me know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Latest Questions

If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Ask a Question!
Recent Questions
  1. Why can't I access the admin page?
  2. ftp application
  3. Large file uploading problem

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!