Using first and last name on registration

Revision as of 08:14, 8 March 2013 by Patricia Schmidt (Talk | contribs)

Overview

In some circumstances, the Admin would like to give the ability to users to have two Custom Profile Fields for First Name and Last Name and convert the native Joomla single name field into two (2) fields.

Newuserregister.png

You can easily convert this into two (2) fields so that it would become:

Newuserregister1.png

Creating the Fields

To do this, you will need to create two (2) special fields in JomSocial Custom Profile Fields.

Navigate to site back End.
From the Components dropdown menu, select JomSocial.
Then select Custom Profiles.
Click New to create the new field.

The first field created will be the First Name field. This field must be a type of Textbox. The title of the field can be set to anything, but the field code, FIELD_GIVENNAME, must be input exactly as shown in the image below:

Givenname.png

The second field follows the same naming convention, only this time we will use the field code, FIELD_FAMILYNAME, as shown in the image below:

Familyname.png

Additional options to be taken care off

There are some additional options that might sound illogical, but they need to be respected as we are creating the special fields to override the way how Joomla! handles the name field. These fields are special fields, and does not abide behind the logic of regular custom fields, therefore, you will need to follow these rules to make them work properly.

  • Set the fields NOT to show on registration - We are overriding the Name field on first registration step which is purely handled by Joomla!, so this setting will not be applied to first registration step. If you set it to show on registration, then you will have same fields on the first, and second registration step
  • Set the fields NOT to be required - Once again, we are overriding the first, Joomla native registration step and once again, this setting have no much sense. Later on, if user edits the profile and tries to leave these fields empty, the last entry stored in the database will still be used.
  • Set the fields to be published - naturally, if you want the fields to be used, you need to publish them

The other available settings can be used as with normal Custom Profile Fields