drupal w CCK - how do I rename node submission buttons
Question
I have made a custom node type for event registration. I have used themes (template.php to all a custom tpl.php for the form) to customise the look of the form.
Using workflow and actions / triggers, people can register for my event, and the event manager gets a notification email and can log in and see a view of who has registered. Neat!
It all works wonderfully, but I can't find a way to rename the default drupal node/add buttons - "save" and "preview" to say "submit registration" and "preview registration". Just a small thing, but quite important to user experience.
Can anyone help me with this?
Solution
Also, you can do without writing a module and just add a custom theme function, as detailed in this tutorial.
Basically you:
- Find the form id
- Create a mytheme
_form_id
theme function that alters the form returns drupal_render($form) (a little different fromhook_form_alter
) - Find the correct form element. I just dpm($form) and look for the result. I think in your case it should be in a 'buttons' array, but don't take my word for it.
- Change the element.
- Implement a mytheme
_theme
hook in your template.php that registers the above-mentioned function
OTHER TIPS
You likely would want to use hook_form_alter() to alter the form and change the names of the submit buttons.
Unfortunately, you have to make a module to do this, because hook_form_alter() is not called on theme files.