bsr
bsr

Reputation: 58712

Drupal : customize status messages (of contact form)


I am setting up a website using drupal 6 and trying to be minimalistic. I use contact form, and it works pretty well. Once the message is sent, it is redirected to the front page of my site with a message "Your message has been sent.".(with a div messages status). How can one change it like,

  1. customize the message content
  2. instead of redirecting to the home page, display a node (another page)

thanks for any suggestion.

Upvotes: 2

Views: 2419

Answers (2)

friendlydrupal
friendlydrupal

Reputation: 601

  1. Change the string for the message. To do that, you can either turn on the locale.module or get string overrides module.
  2. You can create a small custom module to redirect the user using the #redirect property of the Forms API. See here for an example (and check the comments for potential issues).

Alternatively, consider using one of these modules:

Node Destination

Custom (Form) Destination

Rules

Page manager redirect

Upvotes: 1

wiifm
wiifm

Reputation: 3798

For more advanced forms and customisation like you mention above, you should try webform. Webform has the ability to redirect a successful submission to another URL and have a custom status message as well.

Upvotes: 2

Related Questions