The simplest way to extend the fe_users table is to create a small extension that will define the required fields in the database and the TCA. Your small extension will not contain any plugin or other processing.
The Extension Repository Kickstarter (extension key extrep_wizard) extension is a wizard that will help you create this small extension. Install it using the Extension Manager. Once installed, you access the Kickstarter Wizard through the Extension Manager Backend module. There is a tutorial on how to use the Kickstarter Wizard. You may want to go through it. Just remember that you will not need to create any plugin or TypoScript.
Once your extension is created, install it. This will make the fields you have defined available to all other extensions.
You need to update the HTML template in order to include the fields you have defined in the proper subparts. The subparts of interest are:
###TEMPLATE_CREATE###
###TEMPLATE_CREATE_PREVIEW###
###TEMPLATE_INVITE###
###TEMPLATE_INVITE_PREVIEW###
###TEMPLATE_EDIT###
###TEMPLATE_EDIT_PREVIEW###
and perhaps some of the email subparts.
Have a look at how the predefined fields are included in each of the subparts, and do the same for the fields you are adding.
The HTML for a field named myNewFieldName in the CREATE, INVITE and EDIT subparts would look like:
<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->
<dt>
<label for="tx-srfeuserregister-pi1-myNewFieldName">###LABEL_MYNEWFIELDNAME###</label>
<span class="tx-srfeuserregister-pi1-required">###REQUIRED_MYNEWFIELDNAME###</span>
</dt>
<dd>
<!-- ###SUB_ERROR_FIELD_myNewFieldName### -->
<p class="tx-srfeuserregister-pi1-error">###EVAL_ERROR_FIELD_myNewFieldName###</p>
<!-- ###SUB_ERROR_FIELD_myNewFieldName### -->
<!-- ###SUB_REQUIRED_FIELD_myNewFieldName### -->
<p class="tx-srfeuserregister-pi1-error">###MISSING_MYNEWFIELDNAME###</p>
<!-- ###SUB_REQUIRED_FIELD_myNewFieldName### -->
<input id="tx-srfeuserregister-pi1-myNewFieldName" type="text" size="40" maxlength="50" title="###TOOLTIP_MYNEWFIELDNAME###" name="FE[fe_users][myNewFieldName]" class="tx-srfeuserregister-pi1-text" />
</dd>
<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->
In the case of a field of type textarea, check, radio and select, the HTML for the field should rather look like the following:
<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->
<dt>
<label for="tx-srfeuserregister-pi1-myNewFieldName">###LABEL_MYNEWFIELDNAME###</label>
<span class="tx-srfeuserregister-pi1-required">###REQUIRED_MYNEWFIELDNAME###</span>
</dt>
<dd>
<!-- ###SUB_ERROR_FIELD_myNewFieldName### -->
<p class="tx-srfeuserregister-pi1-error">###EVAL_ERROR_FIELD_myNewFieldName###</p>
<!-- ###SUB_ERROR_FIELD_myNewFieldName### -->
<!-- ###SUB_REQUIRED_FIELD_myNewFieldName### -->
<p class="tx-srfeuserregister-pi1-error">###MISSING_MYNEWFIELDNAME###</p>
<!-- ###SUB_REQUIRED_FIELD_myNewFieldName### -->
###TCA_INPUT_myNewFieldName####
</dd>
<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->
In each PREVIEW subpart, you need to add lines like:
<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->
<dt>###LABEL_MYNEWFIELDNAME###</dt>
<dd>###FIELD_MYNEWFIELDNAME###</dd>
<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->
or
<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->
<dt>###LABEL_MYNEWFIELDNAME###</dt>
<dd>######TCA_INPUT_myNewFieldName###</dd>
<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->
Using the Constant Editor, modify the value of the following constants of plugin tx_srfeuserregister_pi1:
formFields: add to the list of fields the names of the fields you have defined and want to be displayed in the Frontend form. If the field is not in this list, the subpart
<!--###SUB_INCLUDED_FIELD_myNewFieldName###--> will be deleted;
requiredFields: add to the list of fields the names of the fields you have defined and want to be treated as required fields. If the field is not in the list OR if the field is in this list and is correctly filled, the subpart
<!--###SUB_REQUIRED_FIELD_myNewFieldName###--> will be deleted.
You may also specify in the TS template Setup some default values and validation rules to be applied by the extension to the additional fields.
If there are no validation rules, you should set:
plugin.tx_srfeuserregister_pi1.create.evalValues.myNewFieldName =
If your field is a select field and if you wish to enable multiple selection, you should also set:
plugin.tx_srfeuserregister_pi1.parseValues.myNewFieldName = multiple
The language labels for the additional database fields should be added in Step1 above. These will be used by the Backend forms.
The language labels used by the Frontend plugin should be added in the TS template setup using the method described in the Localization section of this document. For each language of interest to you with languageCode , you may need the following statements for each additional field with myNewFieldName:
The basic field label:
plugin.tx_srfeuserregister_pi1._LOCAL_LANG.languageCode.myNewFieldName = myNewFieldLabel
The message displayed when the field is required but missing:
plugin.tx_srfeuserregister_pi1._LOCAL_LANG.languageCode.missing_myNewFieldName = missingRequiredFieldMessage
Same as previous but for the invitation form:
plugin.tx_srfeuserregister_pi1._LOCAL_LANG.languageCode.missing_invitation_ myNewFieldName = missingRequiredFieldMessageOnInvitationForm
The message displayed when a validation rule evalRuleName applicable to the field is not satisfied:
plugin.tx_srfeuserregister_pi1._LOCAL_LANG.languageCode.evalErrors_evalRuleName_myNewFieldName = errorMessageForEvalRule