Customizing texts

4 replies [Last post]
pnp61
Offline
Joined: 03/09/2010
Status: 
Answered

Hi,

First time poster so I want to take the chance to congratulate with you about this module.  I like the software and I like your approach to customer support.

I wonder if you could add, or if it is already planned in the upcoming 6.0 release, the ability to customize the text "Choose your Membership Level" and all the other mentioning "membership" like "You will be taken to PayPal to pay for your membership".

I'm asking because in my case (like I guess many others') the "membership" is only a Drupal technicality used to sell what in reality is a subscription to a service. Therefore a text like: "Choose your service" or even "Choose your product" would be more appropriate for the customer/user. I would like to be able to change that and adapt it to the situation.

Thanks, and keep up the good work, Paolo

Leighton Whiting
Offline
Joined: 06/02/2009
Paolo, Thanks, I'm glad you

Paolo,
Thanks, I'm glad you like the software :). Here is my response to your excellent question:

The PayPal jump page text can be changed in the settings for the PayPal gateway.

The 'Choose your Membership Level' can be changed with hook_form_alter(). You can read about that here: http://api.drupal.org/api/function/hook_form_alter

Another excellent way to change strings in modules is by using the String Overrides module: http://drupal.org/project/stringoverrides . This will allow you to change any text in modules.

Hope that helps!

Sincerely,
Leighton Whiting

pnp61
Offline
Joined: 03/09/2010
Aha, thanks, I'm still rather

Aha, thanks, I'm still rather new Drupal. Yes, it helped, I could change one of the texts by adding:

function ponderaid_form_user_register_alter($form, $form_state){
    $form['ms_membership']['mpid']['#title'] =  t('Test text for Choose your Membership Level');
}

to my little module, and I'm amazed by the fact that it indeed worked first time! Amazed because, how  can I know in which orders the modules are read. I mean, it is only by chance that my hook function overrides yours...

Leighton Whiting
Offline
Joined: 06/02/2009
Well, my module registers the

Well, my module registers the form element, then Drupal checks for any overrides, so yours will always override mine with that function. That's the beauty of following Drupal best practice methods.

If there were multiple modules overriding the same form element, then it would depend on the module weight. But that would be very rare indeed.

Sincerely,
Leighton Whiting

pnp61
Offline
Joined: 03/09/2010
Great. I know how to move on

Great. I know how to move on then.

Thanks again

Twitter Feed