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) »
  • Contribution Amount HTML Markup change
Pages: [1]

Author Topic: Contribution Amount HTML Markup change  (Read 1108 times)

datagroove

  • I’m new here
  • *
  • Posts: 22
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: drupal
  • MySQL version: 5
  • PHP version: 5.3
Contribution Amount HTML Markup change
November 11, 2011, 06:50:09 pm
the radio buttons for a contribution pages AMOUNTS have html like this:

Code: [Select]
<div class="content">
  <input onclick="clearAmountOther();" value="741" type="radio" id="CIVICRM_QFID_741_2" name="amount" class="form-radio">
  <label for="CIVICRM_QFID_741_2">$1</label>

  <br>
  <input onclick="clearAmountOther();" value="742" type="radio" id="CIVICRM_QFID_742_4" name="amount" class="form-radio">
  <label for="CIVICRM_QFID_742_4">$10</label>

  <br>
  ...


is there anyway to wrap the input and label for each price in its own DIV? (and get rid of the br)

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: Contribution Amount HTML Markup change
November 12, 2011, 03:49:08 pm
The <br /> is introduced by the code here:

CRM/Contribute/Form/Contribution/Main.php

Code: [Select]
                $this->addGroup( $elements, 'amount', $title, '<br />' );

I could not see a easy way to add "div" elements around the QF code (QF generates the html for the group of radio buttons before sending to smarty)

One potentially hackish way might be to do:

Code: [Select]
                $this->addGroup( $elements, 'amount', $title, '</div><div>' );

and in the file: templates/CRM/Contribute/Form/Contribution/Main.tpl

ensure that you have the opening and closing div:

Code: [Select]

                        <div class="label">{$form.amount.label}</div>
                        <div class="content"><div>{$form.amount.html}</div></div>

lobo
« Last Edit: November 12, 2011, 03:51:33 pm by Donald 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

datagroove

  • I’m new here
  • *
  • Posts: 22
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: drupal
  • MySQL version: 5
  • PHP version: 5.3
Re: Contribution Amount HTML Markup change
November 12, 2011, 10:07:17 pm
Its a hack, but it worked! thank you.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Contribution Amount HTML Markup change

This forum was archived on 2017-11-26.