1

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.

  • Have you tried pageRun hook - docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_pageRun? – jitendra - fuzion Oct 14 '17 at 5:19
  • I've been under impression Event Registration is a form, so was looking for Form hooks; besides, pageRun hook description states, that "This does not execute on every CiviCRM page in the general sense. CiviCRM's pages are classified as either 'Forms' or 'Pages', and this only runs on pages classified as 'Pages'." What do you think? – yurg Oct 14 '17 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.