Community Documentation

Make your site wide contact form look prettier

Last updated October 8, 2009. Created by Mark Conroy on June 24, 2006.
Edited by Dave Reid, webchick, venkat-rk. 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.

Comments

It's even better!

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

Using CSS

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 :) */

awesome

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

I managed to make it look nice, but...

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

Change the category to Contact Us.

http://mulders.me/contact has the category set to Contact Us. The menu entry is Contact Us. Unfortunately the path became contact instead of contact_us.

Joshua Mulders is an environmental architect who started with printed documents then asked a Web developer to make a site based on the print material. The original site is 1990s Wow I worked out how to use a font in an image editor bad. http://mulders.me/ reproduces the original site in Drupal. Switching on the contact page required 11 minutes including reading the page in the handbook, typing in the custom content, and fiddling with the layout. Little things like that make Drupal so much more economical than many of the alternatives. Setting up the whole of http://mulders.me/ in Drupal took less time than adding a contact page to one of the Web applications I worked on last year.

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.

http://drupal.org/project/con

http://drupal.org/project/contact_form_blocks creates a block per contact form category.

change the heading to say, "Contact Us"

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

In my opinion, the contact

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.

Change "Contact" to "Contact Us"

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

mb

http://drupal.org/project/stringoverrides

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

There is an easier way

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.

Are you sure?

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.

Strange, but true

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.

It might be that depends on

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.

block in sitewide contact form

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

contact

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

Thanks

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

Page status

About this page

Drupal version
Drupal 4.7.x, Drupal 5.x, Drupal 6.x

Site Building Guide

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here