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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Styling the CiviContribute page
Pages: [1]

Author Topic: Styling the CiviContribute page  (Read 2640 times)

kmitz

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 2
Styling the CiviContribute page
August 04, 2008, 07:15:25 pm
Hey,

I would like to gather and store some legally required information when someone is making a contribution using CiviCRM Profiles.  I'd like to change the way the form looks, though.  If I build the form and insert the profile in the page via the CiviCRM admin page, can I then copy the HTML source, style it to my liking and place it in a Drupal node?

Any gotcha's???  Is there a better way to do this???

kmitz
« Last Edit: August 04, 2008, 08:09:34 pm by kmitz »

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: Styling the CiviContribute page
August 04, 2008, 10:23:11 pm

any specific reason you dont want to customize the template as described here:

http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+and+Profile+Screens

Contribution is a multi-form, so i do not think that copying the html and placing in a drupal node will not work

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

kmitz

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 2
Re: Styling the CiviContribute page
August 05, 2008, 08:16:15 am
Yes, I've looked at that page, thanks for the reminder.  I read down the page and it looked like I should create a Custom Profile Screen, since I only want the modifications to be used in this instance.

I've determined that the forms I need to modify are CRM/Contribute/Form/Contribution/Mail.tpl and CRM/UF/Form/Block.tpl.  I'd like to make the change only for this Profile (assume profile id = 2), so would the path to the custom forms be CRM/Contribute/Form/Contribution/2/Mail.tpl and CRM/UF/Form/2/Block.tpl?  Or does that only work for the files in the Profile directory (it doesn't seem to be working)?

Also, is there a place where the integer values for variables like $mode and $action can be cross-referenced, or is it different for each file?

Thanks.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Styling the CiviContribute page
August 05, 2008, 12:15:57 pm
In 2.1 you'll be able to customize each of the screens for the online contribution process for a given contribution page ID. This feature is described - with example paths - here:

http://issues.civicrm.org/jira/browse/CRM-2758

I think this might cover your requirements - although you'll need to play around a bit with modifying the the include statements in the custom tpl's to include custom versions of the profile blocks etc.
Protect your investment in CiviCRM by  becoming a Member!

kmitz

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 2
Re: Styling the CiviContribute page
August 05, 2008, 12:55:58 pm
Thanks.  I'll do my best in the mean time.

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Styling the CiviContribute page
August 05, 2008, 02:11:23 pm
Quote from: Dave Greenberg on August 05, 2008, 12:15:57 pm
In 2.1 you'll be able to customize each of the screens for the online contribution process for a given contribution page ID. This feature is described - with example paths - here:

http://issues.civicrm.org/jira/browse/CRM-2758

AWESOME! I was about to post a question on this in the forum - thanks for answering before I asked :)

(Now I'm wondering if I'll be able to merge the changes back to 2.0 ... )
@xurizaemon ● www.fuzion.co.nz

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Styling the CiviContribute page
November 03, 2008, 02:10:12 pm
Being able to customize contribution/event templates based on the ID is great. The php overrides are great too.

It would be *really* cool to be able to have ID-specific php overrides...
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

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: Styling the CiviContribute page
November 03, 2008, 04:30:13 pm

The php overrides are basically free from overloading the php include path. as such i dont think an ID specific php override is in the works. Its code, so adding a conditional within the code file to do different things based on the id should not be too hard.

however, it would be *really* cool for the community to step up and implement this :)

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

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Styling the CiviContribute page
November 05, 2008, 12:45:38 pm
In 2.0, the contribution page ID wasn't passed through to the template.

When I used the Smarty debug window popup to see how I could insert conditionals based on which contribute page, I couldn't see where the ID of the current Contribute page could be queried from.

Eg, if I added {debug} to CRM/Contribute/Form/Contribution/Main.tpl, I see the following variables in the popup for /civicrm/contribute/transact?reset=1&id=12

Code: [Select]
$SCRIPT_NAME
$action
$activeComponent
$bltID
$cancelSubscriptionUrl
$config
$formTpl
$intro_text
$isForm
$is_allow_other_amount
$is_email_receipt
$is_monetary
$membershipBlock
$membershipTypes
$paymentProcessor
$printerFriendly
$recentlyViewed
$session
$showRadio
$singleMembership
$title
$tplFile
$wizard

plus a couple labelled "assigned config file variables" - {#files#} and {#vars#}

NONE of the above (apart from some country IDs in $config) contained "12", which would be the contribution page ID we'd need to check for.

As a result, when I had to implement per-page template customisations for Contribute pages in 2.0, I checked for the value of the $title variable in the template instead. (Obviously less than ideal, but works.)

Dave says above that this will be in 2.1, which is great news.
« Last Edit: November 05, 2008, 12:47:57 pm by xurizaemon »
@xurizaemon ● www.fuzion.co.nz

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Styling the CiviContribute page

This forum was archived on 2017-11-26.