Typo3 Installation Manual for the Feuser Plugin

EXTENDING REGISTRATION FORM WITH SUBSCRIPTION STATUS FIELD

You need to edit template the file Resources/Private/Templates/RegisterHtmlTemplate.html in extension sr_feuser_register. Edit the file 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 cr_newsletter_subscription in the CREATE, INVITE and EDIT subparts would look like this:

<!-- ###SUB_INCLUDED_FIELD_cr_newsletter_subscription### -->
<dt>
<label for="tx-srfeuserregister-pi1-cr_newsletter_subscription">###LABEL_CR_NEWSLETTER_SUBSCRIPTION###</label>
<span class="tx-srfeuserregister-pi1-required">###REQUIRED_CR_NEWSLETTER_SUBSCRIPTION###</span>
</dt>
<dd>
<!-- ###SUB_ERROR_FIELD_cr_newsletter_subscription### -->
<p class="tx-srfeuserregister-pi1-error">###EVAL_ERROR_FIELD_cr_newsletter_subscription###</p>
<!-- ###SUB_ERROR_FIELD_cr_newsletter_subscription### -->
<!-- ###SUB_REQUIRED_FIELD_cr_newsletter_subscription### -->
<p class="tx-srfeuserregister-pi1-error">###MISSING_CR_NEWSLETTER_SUBSCRIPTION###</p>
<!-- ###SUB_REQUIRED_FIELD_cr_newsletter_subscription### -->
###TCA_INPUT_cr_newsletter_subscription###
</dd>
<!-- ###SUB_INCLUDED_FIELD_cr_newsletter_subscription### -->

In each PREVIEW subpart, you need to add lines such as:

<!--###SUB_INCLUDED_FIELD_CR_NEWSLETTER_SUBSCRIPTION###-->
<dt>###LABEL_CR_NEWSLETTER_SUBSCRIPTION###</dt>
<dd>###TCA_INPUT_cr_newsletter_subscription###</dd>
<!--###SUB_INCLUDED_FIELD_cr_newsletter_subscription###-->

Modify the TS template Constants

Using the Constant Editor, modify the value of the following constants of plugin tx_srfeuserregister_pi1: formFields: add the cr_newsletter_subscription field to the list of fields if you want it to be displayed in the Frontend form. If the field is not in this list, the cr_newsletter_subscription field will not be displayed.

/hc/article_attachments/360014538214/1.png

In the Constants editor just type:

plugin.tx_srfeuserregister_pi1 {
# cat=plugin.tx_srfeuserregister_pi1//; type=string; label= Registration form fields: List of fields to be included on the front end user registration form.
formFields = <field_1>, <field_2>, <field_3>, … <field_n>, cr_newsletter_subscription
}

/hc/article_attachments/360014538294/2.png