am I going about this wrong? all I need to do is add a bit of text under the site wide contact form which exists at mysite.com/contact

so, i copied page.tpl.php to page-contact.tpl.php (as per the developer module theme developer) and uploaded it, cleared the cache, and its not loading page-contact.tpl.php its still sticking with page.tpl.php

am i doing something silly?

Comments

gdoteof’s picture

its working exactly as expected. i don't know what i did to trigger it to finally show up

vm’s picture

I believe you have to clear the theme registry before new tpl.php files are made available. This can be done by visiting administer -> themes or manually. The devel.module may even offer some help here.

carlclancy’s picture

I'm new to php and was hoping someone could talk me through how this is done. I also just need to add text underneath the form. I've been scouring the web to no avail, and neither of the drupal books I have are much help.

So I copy page.tpl.php to page-contact.tpl.php - then what?

Thanks in advance.

vm’s picture

then upload it to your theme folder

and visit administer -> themes

check site for functionality you expect.

thomjjames’s picture

Hi,

A different method would be to theme the contact form not the whole page.
Here's how i'd do it, add this to your template.php file:

function YOURTHEMENAME_theme() {
  return array(
    'contact_mail_page' => array(
      'arguments' => array('form' => $form),
    ),			
  );
} 

function YOURTHEMENAME_contact_mail_page($form) {
  $output = drupal_render($form);
  $output .= '<div class="additional-text">'. t('Text to add to bottom of form') .'</div>';
  return $output;
}

Or simpler than that why not add a block with the text in the "content" region?

Worked for me on a test site.
Cheers
Tom
______________________________________________
http://drupalsn.com/user/thomjjames

______________________________________________
https://tomswebstuff.com

carlclancy’s picture

Being a php beginner, I don't know where in my template.php file to insert that code, nor whether or not I should leave in the opening and closing php tags - Everything I've tried results in a blank page when I reload.

carlclancy’s picture

thanks to gdoteof for the pm.

in page-contact.tpl.php i found:

print $content;

and inserted:

print "new content";

Marc Cepeda’s picture

The hooks go in your

 function THEMENAMEHERE_theme(){
}

The rest of the code gets its own function:

 function THEMENAMEHERE_contact_mail_page($form){
}

Caroline Schnapp over at 11heavens.com explains it rather well: http://11heavens.com/theming-the-contact-form-in-Drupal-6

timofey’s picture

In Drupal 7, it changed to page--contact.tpl.php. Notice the double dash --.