[TYPO3-english] sr_emailsubscribe_pi1 extraFields nightmare...

Andrew Plank plankmeister_NO at SPAM_hotmail.com
Thu Mar 19 08:37:04 CET 2009


Andrew Plank wrote:
> Andrew Plank wrote:
>> Hi all,
>>
>> I need to have an extra field added to the sr_email_subscribe signup 
>> process. I created an extension that adds a new field to the 
>> tt_address table, and have modified the template with the extra field, 
>> and have added the following 2 lines of TS to constants and setup 
>> respectively:
>>
>> plugin.tx_sremailsubscribe.formFields = 
>> name,email,membership_number,module_sys_dmail_category,hidden
>>
>> plugin.tx_sremailsubscribe_pi1.extraLabels=membership_number
>>
>> This TS template is included in the root template. I've then added 
>> lines to the locallang.xml file. Upon hitting the front end, however, 
>> This is how the HTML for the additional field (membership_number) 
>> turns out:
>>
>> <!-- ###SUB_INCLUDED_FIELD_membership_number### -->
>> <dt>
>>     <label 
>> for="tx-sremailsubscribe-pi1-membership_number">Medlemsnummer:</label>
>>     <span 
>> class="tx-sremailsubscribe-pi1-required">###REQUIRED_MEMBERSHIP_NUMBER###</span> 
>>
>> </dt>
>> <dd>
>>     <!-- ###SUB_ERROR_FIELD_membership_number### -->
>>
>>     <p 
>> class="tx-sremailsubscribe-pi1-error">###EVAL_ERROR_FIELD_membership_number###</p> 
>>
>>     <!-- ###SUB_ERROR_FIELD_membership_number### -->
>>     <!-- ###SUB_REQUIRED_FIELD_membership_number### -->
>>     <p 
>> class="tx-sremailsubscribe-pi1-error">###MISSING_MEMBERSHIP_NUMBER###</p>
>>     <!-- ###SUB_REQUIRED_FIELD_membership_number### -->
>>     <input id="tx-sremailsubscribe-pi1-membership_number" type="text" 
>> size="40" maxlength="50" title="###TOOLTIP_MEMBERSHIP_NUMBER###" 
>> name="FE[tt_address][tx_golfsportdbmod_member_number]" 
>> class="tx-sremailsubscribe-pi1-text" />
>> </dd>
>> <!-- ###SUB_INCLUDED_FIELD_membership_number### -->
>>
>> That's a direct copy and paste. It's not properly evaluating the extra 
>> field specified by the "extraLabels" property... yet it is correctly 
>> outputting the label. Very, very strange. I've been fighting with this 
>> for 2 hours now, with no result. This site should have been completed 
>> already, so any tips would be most gratefully received...
>>
>> Kind regards,
>>
>> Andrew Plank
> 
> 
> I should mention that I'm using sr_email_subscribe 1.2.7 and 
> fe_user_register 2.5.20

Should there be others who also find themselves in this position, the 
solution is to name the field exactly as it is named in the DB. This 
isn't explicitly stated in the docs. So if you create an extension which 
adds a field, the field in the DB will be named something like (in my 
case) "tx_golfsportdbmod_member_number", so you need to use markers thusly:

###SUB_INCLUDED_FIELD_tx_golfsportdbmod_member_number###
###SUB_ERROR_FIELD_tx_golfsportdbmod_member_number###
###MISSING_TX_GOLFSPORTDBMOD_MEMBER_NUMBER###

And ts thusly:

plugin.tx_sremailsubscribe.formFields = 
name,email,tx_golfsportdbmod_member_number,module_sys_dmail_category,hidden

plugin.tx_sremailsubscribe_pi1.extraLabels = tx_golfsportdbmod_member_number

Hope this helps someone in the future!

//Plank


More information about the TYPO3-english mailing list