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?

Was it helpful?

Solution

Also, you can do without writing a module and just add a custom theme function, as detailed in this tutorial.

Basically you:

  1. Find the form id
  2. Create a mytheme_form_id theme function that alters the form returns drupal_render($form) (a little different from hook_form_alter)
  3. 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.
  4. Change the element.
  5. 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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top