Custom comments form

OnlineWD™ - May 9, 2009 - 00:36

I made a module following this guide http://drupal.org/node/368776. Have removed the homepage field which was my main goal. Now I'd like to know how to add new fields, for example a telephone number? Also I'd like to know how to include the email address as valid mailto and telephone number in a comment. I'm using the comments as a contact form for nodes and Comment mail module for notification when new comments are added to queue. Comments are never published.

So you've altered the form,

nlindley - May 9, 2009 - 01:28

So you've altered the form, but your module doesn't know what to do with the new data. You'll probably want to look at hook_comment(). The extra fields should populate your module's own table in the database.

Don't know where to add a new

OnlineWD™ - May 9, 2009 - 06:20

Don't know where to add a new field though or what code to use for the new field. I haven't modified the form, the custom module removes the homepage field that's all. Where would I add a new field? By the way I think this could be a useful module, I'm using for a gallery which showcases products. People use the comments form to make an enquiry about the item and I use comment mail to notify admin.

If we can create a module which demonstrates many field types and how to edit am sure would be useful to someone else.

I think this can be done

OnlineWD™ - May 9, 2009 - 21:50

I think this can be done using trigger, action and node comment.

How can the parent node be

OnlineWD™ - May 10, 2009 - 00:58

How can the parent node be included in the view? Maybe even the complete parent node at the top and the comment beneathe. The email can include link to created comment/node and admin knows what the enquiry relates to.

Did it using webform and

OnlineWD™ - May 15, 2009 - 01:13

Did it using webform and webform block.

I'm a little surprised no one was able to suggest this, is a simple enough solution.

 
 

Drupal is a registered trademark of Dries Buytaert.