Difference between revisions of "Using first and last name on registration"

(Creating the Fields)
(Overview)
Line 2: Line 2:
 
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.<br/>
 
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.<br/>
  
[[File:Newuserregister.png]]<br/><br/>
+
::: [[File:Newuserregister.png]]<br/><br/>
  
 
You can easily convert this into two (2) fields so that it would become:<br/>
 
You can easily convert this into two (2) fields so that it would become:<br/>
  
[[File:Newuserregister1.png]]
+
::: [[File:Newuserregister1.png]]
  
 
===Creating the Fields===
 
===Creating the Fields===
Line 12: Line 12:
 
To do this, you will need to create two (2) special fields in JomSocial [[Custom Profile Fields]].<br/>
 
To do this, you will need to create two (2) special fields in JomSocial [[Custom Profile Fields]].<br/>
  
Navigate to site back End.
+
# Navigate to site back End.
From the '''Components''' dropdown menu, select '''JomSocial'''.
+
# From the '''Components''' dropdown menu, select '''JomSocial'''.
Then select '''Custom Profiles'''.
+
# Then select '''Custom Profiles'''.
Click '''New''' to create the new field.
+
# 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:<br/>
 
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:<br/>
  
[[File:Givenname.png]]<br/><br/>
+
::: [[File:Givenname.png]]<br/><br/>
  
 
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:<br/>
 
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:<br/>
  
[[File:Familyname.png]]<br/><br/>
+
::: [[File:Familyname.png]]<br/><br/>
  
 
===Additional Options===
 
===Additional Options===
Line 29: Line 29:
 
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:
 
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:
  
'''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.
+
# '''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.
'''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.
+
# '''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.
'''Set  the fields to be published''' - Naturally, if you want the fields to be used, you will need to publish them.
+
# '''Set  the fields to be published''' - Naturally, if you want the fields to be used, you will need to publish them.
 
  The other available settings can be used in the same manner as with standard [[Custom Profile Fields]]
 
  The other available settings can be used in the same manner as with standard [[Custom Profile Fields]]

Revision as of 06:08, 9 March 2013

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.
The other available settings can be used in the same manner as with standard Custom Profile Fields