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) »
  • Problem to change the text of a button to only a specific contribution PHP page
Pages: [1]

Author Topic: Problem to change the text of a button to only a specific contribution PHP page  (Read 2260 times)

smashingx

  • I’m new here
  • *
  • Posts: 17
  • Karma: 1
  • CiviCRM version: 4.1.5
  • CMS version: Drupal 6.22
  • MySQL version: n/a
  • PHP version: n/a
Problem to change the text of a button to only a specific contribution PHP page
May 04, 2012, 09:42:20 am
I want to change the text of one buttron in a PHP page only one contribution page, I used the path the Custom PHP Path as /default/files/civicrm/civicrm_PHP/CRM/Contribute/Form/Contribution. I also created another directory with the ID number of the contribution page to only change that contribution page but it doesn't get it from there, which is what it usually happens with custom templates. Is this a bug, or the procedure is different for PHP pages?

civicrm version: 3.4.7.
drupal version: 6.22
« Last Edit: May 04, 2012, 09:58:07 am by smashingx »

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: Problem to change the text of a button to only a specific contribution PHP page
May 04, 2012, 07:04:21 pm

no, php files do not follow the same ID convention as templates. Pretty sure this is not mentioned in any documentation either

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

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Problem to change the text of a button to only a specific contribution PHP page
May 05, 2012, 01:35:33 pm
smashingx, you will have to edit the default PHP page and examine the id. Or you could jQuery to adjust the text of the button on the client side.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

smashingx

  • I’m new here
  • *
  • Posts: 17
  • Karma: 1
  • CiviCRM version: 4.1.5
  • CMS version: Drupal 6.22
  • MySQL version: n/a
  • PHP version: n/a
Re: Problem to change the text of a button to only a specific contribution PHP page
May 08, 2012, 09:09:39 am
I could change the text of the button but only for all the contribution pages. it seems for me at least for now that the name of the button comes from the PHP page not from the template. And that's why I'm trying to mess with the PHP page.
I was wondering if I could make use of the buildform hook to accomplish this.
Do you guys think is a good idea, or are there any other ways to do it?

Thanks

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Problem to change the text of a button to only a specific contribution PHP page
May 08, 2012, 10:43:18 am
You could try the buildform hook, I'm not sure if it would work. But if does, that's a very good way.

Or my two suggestions above should also work.

 
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

smashingx

  • I’m new here
  • *
  • Posts: 17
  • Karma: 1
  • CiviCRM version: 4.1.5
  • CMS version: Drupal 6.22
  • MySQL version: n/a
  • PHP version: n/a
Re: Problem to change the text of a button to only a specific contribution PHP page
May 09, 2012, 10:02:41 am
By this ->smashingx, you will have to edit the default PHP page and examine the id.
Do you mean adding an if statement with the ID inside the code?

About your second suggestion, I don't have any idea how to do that. :(

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Problem to change the text of a button to only a specific contribution PHP page
May 09, 2012, 10:05:42 am
Quote from: smashingx on May 09, 2012, 10:02:41 am
By this ->smashingx, you will have to edit the default PHP page and examine the id.
Do you mean adding an if statement with the ID inside the code?

Yes

Quote from: smashingx on May 09, 2012, 10:02:41 am
About your second suggestion, I don't have any idea how to do that. :(

How to Customize CiviCRM Pages with jQuery
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

smashingx

  • I’m new here
  • *
  • Posts: 17
  • Karma: 1
  • CiviCRM version: 4.1.5
  • CMS version: Drupal 6.22
  • MySQL version: n/a
  • PHP version: n/a
Re: Problem to change the text of a button to only a specific contribution PHP page
May 11, 2012, 08:43:55 am
The problem that I see with this approach is that the PHP page will be called even if it doesn't need to be called, no like templates that the template will be called only if it has the ID number of the template that needs to be called, otherwise it won't even call that template, for example if the template I'm opening doesn't have a custom template it will open the original template.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Problem to change the text of a button to only a specific contribution PHP page
May 11, 2012, 08:46:08 am
The PHP code is executed for every request anyway. Only templates are cached. So the code is executed. My suggestion is just to add another few lines. There is no performance issue.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Barnacle

  • I post occasionally
  • **
  • Posts: 62
  • Karma: 2
    • White Fuse Media
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.x
  • PHP version: 5.3
Re: Problem to change the text of a button to only a specific contribution PHP page
August 14, 2013, 07:26:37 am
Hi,

This was annoying me so much that I wrote a tiny Drupal 7 module with an admin screen for configuring the text value of every contribution page's "Submit" button.

If anyone else would find this useful then I can make it available, but I'm not sure where best to do that?
--
http://whitefusemedia.com/

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Problem to change the text of a button to only a specific contribution PHP page

This forum was archived on 2017-11-26.