drupaldrupal-themesdrupal-contact-form

Drupal contact form is not displaying a theme


So I've gone and customized the user login/pass/register pages Drupal 6 and no problems. However I now do the same thing with the contact mail page (contact module enabled) and all I get is the contact form and NO theme. What am I doing wrong?

function mytheme_theme() {
  return array(
    'user_login' => array(
      'template' => 'user-login',
      'arguments' => array('form' => NULL),
    ),
    'user_register' => array(
      'template' => 'user-register',
      'arguments' => array('form' => NULL),
    ),
    'user_pass' => array(
      'template' => 'user-pass',
      'arguments' => array('form' => NULL),
    ),
    'contact_mail_page' => array(
      'template' => 'page-contact',
      'arguments' => array('form' => NULL),
    ),
  );
}

Solution

  • To theme a full page you shouldn't need to add that item into your code at all (in fact, it may be the reason you're not getting any theme - your item is conflicting with the default behaviour).

    Presuming the url for your contact page is "http://www.your-site.com/contact", just create page-contact.tpl.php in your theme directory (..and clear the theme registry, gets me every time).

    This goes for all pages - create a template based on page.tpl.php, and named after the url arguments. For example, page-taxonomy-term.tpl.php will be used to theme http://www.your-site.com/taxonomy/term.