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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Customizing forms deeper than custom .tpls
Pages: [1]

Author Topic: Customizing forms deeper than custom .tpls  (Read 1619 times)

Thinkling

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
Customizing forms deeper than custom .tpls
May 15, 2008, 04:13:19 pm
I'm looking to customize/tweak the appearance of a Contribution Form. For example, I'd like to output the donation amounts and their "names" in columns so they align nicely, one column of amounts and one column of labels.

I've read "Customize+Built-in+and+Profile+Screens" and found the corresponding template (Contribute/Form/Contribution/Main.tpl, iirc); it outputs $form.amount.html. How do I reach in deeper to affect the HTML that's generated?

Is it common for people who want substantial layout tweaking to save out a static copy of the form HTML and hack that? I'd rather not go there yet.  :)

Thanks!

(Drupal 5.7/CiviCRM 2.0.1)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Customizing forms deeper than custom .tpls
May 15, 2008, 10:07:07 pm
Hi,

Although I've been stopped because the template would just spit precalculated html, I often found workarounds:

Enable debug, &smartyDebug=1 and look at the variables set in the template. You might have all what you need.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Customizing forms deeper than custom .tpls
May 17, 2008, 08:26:03 am
The "amount" radio button group is created in CRM/Contribute/Form/Contribution/Main.php - builtAmount() function. It is created as a "group" - and Quickform allows you to specify delimiter characters between each element (e.g. each radio button item) - this is currently set as <br />. You'll have to play with the code to see if / how you could do the table layout instead...
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Customizing forms deeper than custom .tpls

This forum was archived on 2017-11-26.