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) »
  • Getting modified .tpl files to work for contribution transaction pages?
Pages: [1]

Author Topic: Getting modified .tpl files to work for contribution transaction pages?  (Read 1653 times)

skyebend

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 3.2.5
  • CMS version: Drupal
  • MySQL version: ?
  • PHP version: ?
Getting modified .tpl files to work for contribution transaction pages?
January 27, 2011, 03:09:31 pm
Hi Folks,
  I've done lots of other web work, but am new to CiviCRM so pardon me if the answer is obvious.


Context:
I'm trying to help a grassroots non-profit add basic webstore that will collect contact info from customers into the contact database.  I couldn't find enough information about the UberCart+civi connection, and it seemed overkill since they just want to sell a few shirts and posters.  So I've set up a crude solution using the Premiums features so people can "donate", give shipping info, and receive a shirt. That seems to work OK.

Problem:
I'd like to clean up the UI a bit by re-ordering some of the profile blocks on the contribution page.  Documentation seems to suggest that the best way to do this is by creating a new .tpl template file to overide the existing one for the specific page id.

wiki.civicrm.org/confluence/display/CRMDOC32/Customize+Built-in%2C+Profile%2C+Contribution+and+Event+Registration+Screens

When I look in the page

myFavoriteNonProfit/civicrm/contribute/transact?reset=1&id=2

I find that it is using the template file:

<!-- .tpl file invoked: CRM/Contribute/Form/Contribution/Main.tpl. Call via form.tpl if we have a form in the page. -->

So I set up a parallel directory structure, copy Main.tpl, make a change, check that the "Custom Templates" path in Administer > Global Settings > Directories points to  the root of the new directory structure, turn on debugging, and load the page with &directoryCleanup=1.

Nothing changes.  The SmartyDebug panel indicates that no template was loaded.   Unfortunatly, I can't check that it is using the CustomTemplate path I set, because the smarty debug window truncates the variable.


Question:


Is this the wrong way to go about it?

Does anyone have an example where they've been able to overide a template for a contribution page? 

The examples at wiki.civicrm.org/confluence/display/CRMDOC32/Customize+Built-in%2C+Profile%2C+Contribution+and+Event+Registration+Screens don't actually demonstrate this case, am I correct in infering that the path to my custom template to overide a transact page with id=2 should be

CRM/Contribute/Form/Contribution/2/Main.tpl

(I've tried both with and without the /2 ) subdir.

Any suggestions on how I might start debugging this?

thanks for your help,
 -skye

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: Getting modified .tpl files to work for contribution transaction pages?
January 27, 2011, 05:53:25 pm

a couple of things:

1. can you cut-n-paste exactly the template path you entered in the UI (you can change any host specific identification)

2. can you cut-n-paste the full path of your modified Main.tpl (again doing the same change as above)

might be easier and quicker to debug and fix this on IRC: http://webchat.freenode.net/?channels=#civicrm

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

skyebend

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 3.2.5
  • CMS version: Drupal
  • MySQL version: ?
  • PHP version: ?
Re: Getting modified .tpl files to work for contribution transaction pages?
January 27, 2011, 06:44:47 pm
Directories path:
myFavoriteNonProfit/web/sites/default/files/civicrm/customtpl/
myFavoriteNonProfit/web/sites/default/files/civicrm/customtpl/CRM/Contribute/Form/Contribution/Main.tpl

also

myFavoriteNonProfit/web/sites/default/files/civicrm/customtpl/CRM/Contribute/Form/Contribution/2/Main.tpl

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: Getting modified .tpl files to work for contribution transaction pages?
January 27, 2011, 08:25:18 pm

can you jump on IRC sometime and we can try debugging it there (a bit easier since its interactive)

the settings seem right, so not sure why its not working :(

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

halb

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 4.0
  • CMS version: Drupal7
  • MySQL version: 5
  • PHP version: 5.2
Re: Getting modified .tpl files to work for contribution transaction pages?
January 09, 2012, 11:15:13 am
Not sure this was the original posters problem (since there was never a conclusion), but I had an identical sounding issue, which led me to this post. Donald help me solve it on irc. In my case, the file path to the custom templates folder is absolute, and I was working on two different systems (home and work), and the filesystem paths were different. And thus caused my problem.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Getting modified .tpl files to work for contribution transaction pages?

This forum was archived on 2017-11-26.