forms

Override the Drupal Contact Form

Last week a client of ours at CHROMATIC requested an addition to the default contact form that ships with Drupal. Essentially, they just wanted to add a required “Phone Number” text field to the form. Additionally, they wanted this value to be sent along with the email that the contact module sends. One solution would have been to ditch the contact.module and just whip up a new page using the WebForm module. The other solution is to override both the form/email using the following hooks respectively in our own module:

Disable Comments by Default

A quick post here. Often times I find myself building sites that have a blog and thus use the Comment module that ships with Drupal. That all works great. The problem is, later when I’m building out other content types, say Photo Galleries, I more often than not wish to disable comments on those node types. No problem, right? Just disable comments and get on with it. Well no – it’s not all right with me. I think comments should be disabled by default or at the very least, the Comments fieldset should be expanded by default so that you’re reminded to turn them off. Unfortunately, neither of these things are true on Drupal 6.

Categories: