CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Customizing contribution pages
Pages: [1]

Author Topic: Customizing contribution pages  (Read 2006 times)

sdybiec

  • Guest
Customizing contribution pages
July 02, 2008, 06:32:33 am
Thanks for the really awesome product. Very flexible and well thought-out. Here's my question.

I figured out how to customize the contribution form (CRM/Contribute/Form/Contribution/Main.tpl) using this documentation: http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+and+Profile+Screens

It works, but the template changes apply to every instance of my contribution form/pages.

Like the profile capability, I'd like a customized template per contributon page ID. Is this possible? I tried a couple paths without any luck:

CRM/Contribute/Form/4/Contribution

and

CRM/Contribute/Form/Contribution/4

Is it possible to create customized contribution templates per ID?

$cott

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Customizing contribution pages
July 02, 2008, 12:06:34 pm

This feature is coming in v2.1.

You can try to backport the code from trunk, the issue and patches are here:

http://issues.civicrm.org/jira/browse/CRM-2758?page=com.atlassian.jira.ext.fisheye:fisheye-issuepanel

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

yasheshb

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 5
Re: Customizing contribution pages
July 18, 2008, 04:44:00 am
hi.

Is there a way to get the contribution page id in the smarty template CRM/Contribute/Form/Contribution/Main.tpl
(http://www.example.com/civicrm/contribute/transact?reset=1&action=preview&id=3&smartyDebug=1)

I checked the smarty template variables
{php}
  $all_tpl_vars = $this->get_template_vars();
  print_r($all_tpl_vars)
{/php}

but could not locate the contribution id which was being veiwed during a test drive.

thanks.

yashesh

p.s. there is a smarty variable
$session['_session:protected']['CiviCRM']['pastContributionID']
and
$session['_session:protected']['CiviCRM']['CRM_Contribute_Controller_Contribution_4db813de4a2c26a9f93b2f0ac787c381']['id'] which do contain the contribution page id.
would it be prudent to use them in the custom template ?


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Customizing contribution pages
July 18, 2008, 12:36:54 pm

you cannot use that variable, since it changes for every run ($session['_session:protected']['CiviCRM']['CRM_Contribute_Controller_Contribution_4db813de4a2c26a9f93b2f0ac787c381']['id'])

You can potentially use: $session['_session:protected']['CiviCRM']['pastContributionID'], but i'd avoid it

Better yet, add:

$this->assign( 'contributionPageID', $this->_id );

CRM/Contribute/Form/ContributionBase.php, line 142

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Customizing contribution pages

This forum was archived on 2017-11-26.