Hi there. I'm trying to remove the title: "Contact" from the contact form. Interestingly I cant even find out how to change it, which would be better than nothing.. If I change the title in the contact.module (shown below) nothing happens. Could someone help me out? Thanks!

$items['contact'] = array(
'title' => 'Contact',
'page callback' => 'drupal_get_form',
'page arguments' => array('contact_site_form'),
'access arguments' => array('access site-wide contact form'),
'type' => MENU_SUGGESTED_ITEM,
'file' => 'contact.pages.inc',
);
$items['user/%user/contact'] = array(
'title' => 'Contact',
'page callback' => 'drupal_get_form',
'page arguments' => array('contact_personal_form', 1),
'type' => MENU_LOCAL_TASK,
'access callback' => '_contact_personal_tab_access',
'access arguments' => array(1),
'weight' => 2,
'file' => 'contact.pages.inc',

Comments

carnevaledesign’s picture

Found this: http://drupal.org/node/161624#comment-4609940. In your case, if you want to completely remove the title, I would do this:

<?php
/**
* Implementation of hook_form_FORM_ID_alter()
*/
function mytheme_form_contact_site_form_alter(&$form, &$form_state) {
  drupal_set_title(null);
}
?>

Replace "mytheme" with your theme's folder name.

chiappa’s picture

Thanks! But didn't work for me. I also tried just to change the name but no effect.

Currently I have the following added to my css, shame shame shame.. =)

div.panel-pane.pane-contact {
color: #ffffff;
}

label {
color: #000;

}

carnevaledesign’s picture

To be honest, I didn't have time to test it out. Did you make sure to clear your cache? If that didn't work, you may need to deactivate your theme and enable it again. Drupal won't see that you have created a template.php file until you do this.

If that doesn't work, I would recommend using the extremely popular Webform module. This will not only allow you to create your own contact form, but you can also set the title to whatever your heart desires.

chiappa’s picture

I tried clearing the cache. Now I also tried deactivating and re-activating my theme.. But I have noticed before that if I added something to template.php drupal would immediately complain about it.

I had a quick look at the webform module before, but it looked rather complex for my needs. On a closer look, I'll have a go. Thank you very much for your suggestions.

chiappa’s picture

For the next sucker here is what I went trough using panels & panels everywhere on drupal 7.4

I made a block using the webform module and put it in a panel. The title was still showing up & there was nowhere to turn it off on the webform module settings. So I found this page: http://drupal.org/node/415580 and tried all that but nothing worked.

Finally I found out that with panels you can remove the title for blocks by changing the style of the content to: No markup at all.

So most probably that works also for the contact module but I am glad I changed to the webform module because I can have extra input boxes on the form.

Once again, the panels module prevails :)

http://img97.imageshack.us/img97/8915/contactformwhitebox.jpg

http://img855.imageshack.us/img855/1298/nomarkupatall.jpg