Using first and last name on registration

Revision as of 06:08, 9 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.

  1. Navigate to site back End.
  2. From the Components dropdown menu, select JomSocial.
  3. Then select Custom Profiles.
  4. 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

There are additional options that may not seem logical, but they need to be respected because the special fields are being created to override the way Joomla manages the name field. These fields are Special Fields and do not follow the logic of the standard custom fields; therefore, you will need to follow these rules to make them work properly:

  1. Set the fields to NOT show on registration - We are overriding the Name Field in the first registration step which is solely handled by Joomla, so this setting will not be applied to the first registration step. If you set it to show on registration, then you will have same fields in the first and second registration steps.
  2. Set the fields to NOT be required - Once again, we are overriding the first, Joomla native registration step and, once again, this setting does not appear to make much sense; however, later on, if the user edits the profile and tries to leave these fields empty, the last entry stored in the database will still be used.
  3. Set the fields to be published - Naturally, if you want the fields to be used, you will need to publish them.
  4. The other available settings can be used in the same manner as with standard Custom Profile Fields.