Make your site wide contact form look prettier

Last modified: October 8, 2009 - 14:34

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.

It's even better!

Kodeart - May 8, 2007 - 11:11

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

bechdol - August 26, 2007 - 02:39

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

koppie - November 11, 2008 - 03:07

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...

brelleva - May 20, 2009 - 15:47

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.

peterx - July 19, 2009 - 08:07

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.

change the heading to say, "Contact Us"

scooogie - September 20, 2009 - 17:15

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

 
 

Drupal is a registered trademark of Dries Buytaert.