Adding Custom User Profile Fields in Joomla 2.5 – Step 1/3 – Copy the Plugin

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.

The default Joomla 2.5 user profile plugin allows your site users to input more information about themselves than what is by default allowed. You can find more information here on the fields included by default within the Joomla 2.5 user plugin.

There are many users that would like to add more fields to the plugin to make it work better for them. For example, if you’re running a website about baseball, you may want to allow people to input their favorite baseball team or what position they play.

To add new fields to the user profile plugin, you will need to edit the plugin itself. This is not always an easy task, so be sure to find a solid tutorial, such as this one, that walks you through all of the needed steps. In the next few tutorials, we’re going to show you how to create a custom user profile plugin so you can add additional custom profile fields.

In this first tutorial, we’re going to make a copy of the current user profile plugin. We’re not going to edit the current profile plugin because we may lose any changes we make if Joomla updates the files.

Steps to create a copy of the current user profile plugin in Joomla 2.5

  1. Create a folder on your desktop named profile10.
  2. Connect to your Joomla server via FTP.
  3. Copy all files in the plugins/user/profile folder into the profile10 plugin folder on your desktop.
  4. Copy the following files from /administrator/language/en-GB to the profile10 folder on your desktop.

    en-GB.plg_user_profile.ini
    en-GB.plg_user_profile.sys.ini

  5. In the profile10 folder, Rename the following files:

    en-GB.plg_user_profile.ini to en-GB.plg_user_profile10.ini
    en-GB.plg_user_profile.sys.ini to en-GB.plg_user_profile10.sys.ini

  6. The following steps will require that we change several references of “profile” to “profile10“, the name of our new user profile plugin. Find the following lines in the following files, and make the necessary changes.

    profile.xml

    Rename profile.xml to profile10.xml in the code of the file.

    LINE 3:  <name>plg_user_profile10</name> LINE 14: <filename plugin="profile10">profile10.php</filename> LINE 19: <language tag="en-GB">en-GB.plg_user_profile10.ini</language> LINE 20: <language tag="en-GB">en-GB.plg_user_profile10.sys.ini</language>
  7. Rename profile.php to profile10.php.
    LINE 18: class plgUserProfile10 extends JPlugin
  8. Zip the profile10 folder on your desktop to profile10.zip.
  9. Check the User – Profile Plugin. If it is enabled, disable the standard User – Profile plugin
  10. Just like any other plugin, install the profile10.zip plugin.

    Our next step is to update the user facing user profile form so that users can type in a value for the new field that you will be adding.

Thoughts on “Adding Custom User Profile Fields in Joomla 2.5 – Step 1/3 – Copy the Plugin

    • I double checked steps 1 to 9 of your instruction and everything was OK. However I was not able to install the new profile 10 plugin in my J 3.4.8 version. I was getting following messages:
      JFolder: :delete: ……
      Path: /home/xxxxxxx/plugins/user/profile/profiles
      JInstaller: :Install: File „/home/xxxxxx/logs/install_56c06fd187511/profiles10“ does not exist.

      What could the problem be?
      BTW. Line 6 of your tutorial 1/3 is a bit unclear to me: Has the file profile.xml to be renamed to profile10.xml itself or only the code inside the file?

      Thanks for your help.

  • Hello. I having a trouble uploading my new plugin. I followed the instructions above change it into profile10 still has an error stating, “Plugin Install: Another plugin is already using directory: /hsphere/local/home/a897837/filestatecorp.com/mrtshops/plugins/user/contactcreator“. Any ideas how to solve this? I will really appreciate your help.

    • Hello justine,

      Thank you for your question. I found a similar issue with a different plugin in the official Joomla Support Forum, where they are offering several solutions.

      If you have any further questions, feel free to post them below.

      Thank you,
      John-Paul

  • It is not a bug
    You should edit the profile10.xml file.

    At line 16 you should find this
    <folder>profiles</folder>

    at line 17 add the following

    <folder>fields</folder>

    In this way Joomla will know that the plugin also needs the fields folder

Leave a Reply