0

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),
    ),
  );
}
apaderno
  • 28,547
  • 16
  • 75
  • 90
EddyR
  • 6,891
  • 7
  • 42
  • 50

2 Answers2

1

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.

Heather Gaye
  • 1,118
  • 1
  • 11
  • 19
  • I tried to add a node-contact.tpl.php file but Drupal isn't using it. – EricP Dec 16 '10 at 18:58
  • EricP: there are a whole stack of reasons why it might not be working, but without knowing your setup, it's difficult to pinpoint. Upshot: node-contact.tpl.php to theme just the content of a page (which I assume is what you're trying to do) isn't a default template format. You can use node-.tpl.php or node-.tpl.php to theme the content for specific types or individual nodes. If you want to re-theme just the content of a (non-node) contact form, the fastest option is to use a form_alter hook. – Heather Gaye Jan 04 '11 at 00:52
0

It looks like you are creating a module rather than a theme. With drupal6 you can extend an exsisting theme, negating the need for you to try and override the theme for each item.

Have a look at base theme in the theme .info file, and the documentation on creating your own theme

Jeremy French
  • 11,707
  • 6
  • 46
  • 71