How do I change the contact form heading to say, "Contact Us".
Not sure if this is a theme or a module question. I am using the Aboutpeople theme and have been racking my brain as to how to update the heading on the contact form to say "contact us". When I created the site-wide form, I made the category name 'contact us' - I see nowhere else to name the form. The form does show up in the navigation as 'Contact Us', but the page heading says 'Contact'. I have searched around the forum and have yet to find a solution.
I did see a similar post (from Nov. 2006) that says to edit the modules/contact.module - to find and edit this line: 'title' => t('contact') - but the module in the theme I am using does not have such an entry, it only refers to the category (which I have as 'contact us').
Not sure why this is such a difficult thing to do.
thanks

=-=
investigate the string_overrides.module with it you may be able to change the reference contact to contact us as it is in a t ('string') somewhere.
use theme_preprocess_page
I recently wanted to do this and found that the easiest way was to use theme_preprocess_page() in template.php to remove the title on the contact page. I then added my own H1 tag to the additional information of the form (/admin/build/contact/settings).
Here's the code I used in theme_preprocess_page():
function newswire_preprocess_page(&$vars, $hook) {if ( arg(0) == 'contact' ) $vars['title'] = '';
}
A few things things to note on the above code. If you don't have a template.php file in your theme folder, you'll have to create it. Put the above code in your theme's template.php. Be sure to replace newswire_ with yourthemename_. Also note that I checked arg(0) for the value 'contact'. That may change depending on the path to the contact form.
http://w5pc.org
...
You can just set the title right there in the variable, and you probably want to check if the contact module is enabled:
if (module_exists('contact')) {if (arg(0) == 'contact') {
$vars['title'] = t('Contact Us');
}
}
btw, drupal coding conventions encourage curly braces even if they not needed.
Professional Drupal Design and Theme Services
This worked for me - adding 'us' to contact form title
Thank you!
I found the function 'theme_preprocess_page' in my current theme template.php and entered code as jmburnz advised.
So the whole thing looks like this:
function myThemeName_preprocess_page(&$vars, $hook) {
global $theme;
// If contact module is enabled, set title of page to 'Contact us'
if (module_exists('contact')) {
if (arg(0) == 'contact') {
$vars['title'] = t('Contact us');
}
}
(where 'myThemeName' = your theme name)
Just uploading template.php to directory and refreshing the page made the title appear how I wanted. Fantastic!
Doesn't work with my theme
My theme didn't had 'theme_preprocess_page' so I created template.php with content you suggested and replaced ('myThemeName' = with my theme name). After uploading contact page gives me only white page. Removing template.php file gives me back my contact page. Any suggestions what went wrong?
You would have to put your code up here...
...for some nice drupal person to look at.
Sorry, I'm not so hot on knowing all the things that could go wrong (could be a million things, and I'm gradually finding them, one by one).
How did you create the template.php file? Did you follow guidelines for what it should contain?
Check out some documentation:
http://drupal.org/theme-guide
and a video that helped me: Fine-tuning the UI by Theming Forms in Drupal 6.0 (video) http://blip.tv/file/1139210
cache
Have you tried emptying the cache?
thanks for this!
small thing, but seems like a good idea.
John Kenney
CallingGuides.com