Preamble:
Event Registration Settings form ( civicrm/event/manage/settings?reset=1&action=update&id=EVENT-ID ) has separated text areas for Event Summary/Description ( "Info and Settings" tab) and Introductory Text ( Online Registration tab ).
We'd like to use both at Online Registration Form (civicrm/event/register?id=EVENT-ID&reset=1) or only Event Summary/Description in order to eliminate same text copy&paste twice for both "description" fields.
Assuming one of civicrm hooks in a custom Drupal module can be used, just more convenient than custom template creation
Code
Something like this
if($formName == 'CRM_Event_Form_Registration_Register') {
$form->_values['event']['intro_text'] = $form->_values['event']['description'];
}
Problem
There are hooks which, according to descriptions, must execute the below code but somehow it doesn't work:
- hook_civicrm_preProcess
- hook__civicrm_buildForm
There are also hook_civicrm_alterContent (which can do str_replace inside given text) and hook_civicrm_alterTemplateFile (which can help in TPL file substitution somehow), yet both aren't suitable for the situation.
Question
Any chance hook_civicrm_preProcess/hook__civicrm_buildForm can be used or custom copy of civicrm\templates\CRM\Event\Form\Registration\Register.tpl alter is the only option here?
Thanks!
P.S. There are some related discussions regarding these hooks here; unfortunately solutions proposed do not work somehow.