5

Big picture: I want to display some custom data on a thank you page for a specific contribution page. In my module I'm using hook_civicrm_preProcess. Like so:

   function custom_thankyou_civicrm_preProcess($formName, &$form) {

if ($formName == "CRM_Contribute_Form_ContributionPage_ThankYou" && ($form->getVar('_id') == 5)) {   

// do stuff, like send my custom data to a smarty template. 

} }

But here's the problem, my customized message doesn't show up on the thank you page for that contribution. It does however show up on the configuration screen for "Thank-you and Receipting" in the civi interface.

I guess it's not too surprising since the url for the config page is:

mycivicrmhost/index.php?q=civicrm/admin/contribute/thankyou&reset=1&action=update&id=5

and the url for the thank you page ends up being one like this:

mycivicrmhost/index.php?q=civicrm/contribute/transact&_qf_ThankYou_display=1&qfKey=3ee9c31da51b3af9dbe8c8efa5765520_1396

Is it possible to do this or should I set up an "external" thank you page instead?

Thank you

5 Answers 5

1

I would think that using a custom template would work, there is a thank you page template. If it is only one contribution page you're looking to add, some quick logic based on contribution page id would work. You can also try some custom behaviors with jQuery: https://civicrm.org/blogs/dave-greenberg/now-its-easier-add-custom-behaviors-templates

0

I would expect that the Contribution Page does not trigger the postProcess hook as this operates on forms, not on pages. I would imagine you could use the pageRun hook though? I have not tried it....

2
  • Thanks for the suggestion to try pageRun. Unfortunately, as far as civi is concerned, the thank you screen displayed after a contribution is neither a Form nor a Page. Arg.
    – Peter_
    Commented Oct 28, 2015 at 3:28
  • Worth a try, a pity it did not work :-) Commented Oct 28, 2015 at 12:11
0

The best way (I would recommend) to do is to create an own page of your own - and displaying the thank you page

Or overriding the thank you page from core into civicrm custom folder - that will solve the problem

0

You can customize the thank you page using custom template.

http://wiki.civicrm.org/confluence/plugins/servlet/mobile#content/view/86213551

0

You can also customize the thank you page using custom template.

http://wiki.civicrm.org/confluence/plugins/servlet/mobile#content/view/86213551

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.