Cusomising drupal forms

I want to change the output of some forms in drupal, specifically the ones generated by the fivestar plugin. I want to change the labels and the title text where it says ‘give it 4/5’.

I have been looking at form alter but I am not sure how to target this specific form as the id of the form is unique for each page on my site (it adds the node id as part of the form id).

Any ideas?

I don’t think you’ll be able to change it via a hook_form_alter function. I just had a look at one of my sites using the fivestar module and the form_id was “fivestar_form_node_1308”. Because the node ID is part of the form_id it’ll be hard to target.:frowning:

You could look at overriding a theme, specifically the “theme_fivestar_widget” in fivestar.module. Also look around the other theme_fivestar_* function.

Or another option would be to use String Overrides module. Sorry can’t post URLs yet, it’s a policy on this forum because I have 5 posts of less. Just google the module name. This module let’s you override string/text which has been passed via the t() function.

Hope this help. Let me know what you end up doing.:slight_smile:

Thanks very much gains. Unfortunately none of the functions in the fivestar module allow you to override the title text, this is done in the fivestar_form_alter function which I dont think you can override.

I cant use the sting overrides module either because the client does not want too many external modules to be installed :frowning:

I can’t believe there is not an easy way to change this text but for now I will have to admit defeat.