Last updated 2 March 2015. Created on 24 June 2006.
Edited by NonProfit, Dave Reid, markconroy, webchick. Log in to edit this page.

Drupal ships with a sitewide contact form since version 4.7 that you can use to allow site visitors to send feedback. As mentioned in the help text on the contact form settings page, you can also use the body area just above the form to give site visitors your postal address or share any other information.

However, because you can't specify an input format for the contact form page, the additional information you add will display without linebreaks or paragraph breaks and look pretty ugly.

There is a simple workaround for this. Just put <br> and <p> tags where you want the linebreaks and paragraphs to appear and you will have a nice looking contact page. Experiment with the line break and paragraph break tags until you are satisfied with the appearance of your contact page.

This functionality has been removed in the Drupal 7 version. The preferred approach is to add a new block using the Block module and setting your new block to be displayed only on the 'contact' path.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

Kodeart’s picture

Just for the record, you can also add (after you find WHERE to put it):
<h1> <h2> <h3> <h4> <h5> <h6> <em> <strong> <code> <del> <blockquote> <q> <sub> <ul> <ol> <li> <dl> <dt> <dd> <a> <b> <u> <i> <sup>
Basically, tags from the famous "Filtered HTML" input format and some more.

I'm still wondering, why *pretty* is used in this documentation. Actually, these tags are *ugly*. You cannot pretty-anything unless you go and change something in your theme's css. As a kind of semi-css-professional first you have to find (and code/change correctly) the classes, ids and whatnot, and then try to make it pretty, without ruin your whole theme layout in a first place. If you're not comfortable with css...well, it's time to start learning it. It's fun! You don't want to Bluemarine your website, don't you?

mixa @ Kodeart Softworks

bechdol’s picture

Well, it appears that since you can put anything in the "Additional information" section under the settings tab, I put in some

tags and added some CSS:

form #contact-mail-page #my-fancy { /* blah blah blah :) */

koppie’s picture

I was struggling with this. Looks like there's been talking of allowing non-scrubbed content on the Contact form since 2005, and yet it's never happened. After wading through several sites explaining how to hack Drupal to get this functionality, I was ready to turn off the damn module and give up. And then I saw your tip. Not only does it work, but frankly it's a lot more graceful. Maybe it seems painfully obvious to you but it was a breakthrough for me. Thanks!!!

--Koppie

brelleva’s picture

I cannot figure out how to change the heading to say, "Contact Us". The category is 'contact us' and this is how it is displayed in the navigation. However I'm having no luck altering the page heading. Some have suggested finding the t('contact') in one of the include files or modules...but no luck. It appears configured to pull the heading from the assigned category. I've deleted and started over a few times (each time naming the category 'contact us') and cleared the site cache. I'm at a dead end. Please help.

thanks

peterx’s picture

A site has the category set to Contact Us. The menu entry is Contact Us. Unfortunately the path became contact instead of contact_us.

I would like to see the contact form available as a block to use in an existing page so that the page can offer people selection lists and other choices. There is probably a module to do that. Some links from this page to contact related modules would be of use. I found some modules but have not used them and added them to the documentation page in the hope that people will try the modules then add their experience.

peterx’s picture

scooogie’s picture

At first glance, this module appears to have what you are looking for: http://drupal.org/project/contact_forms

miketitsch’s picture

In my opinion, the contact form's title should not be hard-coded into Drupal. It should be a field on the settings page.

The code in Drupal 6.15 is line 93 in modules/contact/contact.module

If you want the form to have a title of "Contact Us" instead of "Contact" change line 93 from this:

'title' => 'Contact',

to this:

'title' => 'Contact Us',

You may have to clear your cache after making the change in order to see the new title correctly (both your browser and Drupal's Performance cache). Also, it is always wise to keep a running log of any changes you make to a core module (or any module, for that matter), because you will have to make the changes again when the module is overwritten during an upgrade.

lionroar’s picture

There is a module called "string overrides" which takes care of that flawlessly. Hope that helps.

markconroy’s picture

Yes, String Overrides is a great module for this kind of work. Using it also means you don't have to make a change to contact.module every time you upgrade your version of Drupal.

http://drupal.org/project/stringoverrides

ian-moran’s picture

I know this is an old thread, but if anyone else is looking for this you can change the title of the contact page by altering the title of the contact form link in the navigation menu.

markconroy’s picture

Are you sure that doesn't just change the title in the menu? I don't think that changes the title on the menu page.

ian-moran’s picture

The page title is set in includes/path.inc by drupal_get_title(), so if it finds the contact page menu item in the navigation menu it will take the menu item title and use it as the title on the contact page. The menu item in navigation does not need to be enabled.

Try it out.

FrancescoUK’s picture

It might be that depends on the theme, but it doesn't work for me (D7).
In the main menu it's Contact Us and the Contact form title is Contact. I used stringoverride to fix the issue.

I'm finding weird that this contact form title cannot be changed normally from a setting page.

swara05’s picture

hii im using d7....new in drupal ..& i want to place block in to site wide contact form ....bt the qus is that im not able to specify path for contact us form ????how cn i do that .....any help ..thanxx

markconroy’s picture

in the textarea below where it says "show block on every page except" or "show block on only the following pages", put in the word contact

since your contact form is located at example.com/contact

the word "contact" (without quotation marks) will mean the "drupal-path.com/contact

If you also want it on your yoursite.com/about page, then you could just put in the word about

swara05’s picture

Thanks Mark..i got that where i place only contact.