Contact form block with data from the page the blocks featured on So I have a content type "Real Estate." On the view for a "Real Estate" node, I want to have a contact block in the right side bar that has a feild for the node id of this specific "Real Estate" node.

An example of the feature I'm trying to make can be seen here

This problem has two parts which I'm not sure how to do. The first is that I don't know how to make a block for a contact form. I know drupal has a default Contact module but I'm not sure how to turn this into a block or even if that is the best way to go (maybe WebForms module can help?) Second is that I'm not sure how to pre-load the node id into the form. I'm sure that this would require a hook of some kind but seeing as I don't know how to make the contact form block, I don't know what hook to use.

Any help would be much appreciated. Thanks!
If you don't want to write custom theming and you want less coding, you need to create a custom page with 2 columns using panels module.


Install the panels and ctools modules if you don't have.
Enable Chaos tools, Page manager and Panels.
Create a custom page at admin/structure/pages/add with the path "estate/%node" which will be a new mirror page of the existing path "node/%node".
Assign Node: ID context to the argument %node.
Choose two column layout.
Add Existing node to the left column. To use a NID from the URL, use %1 in the title box.
For the right column, add the contact form from Widgets.


To get node information in the contact form, you need to write a hook hook_form_FORM_ID_alter in your custom module using the argument NID.
You can study custom moduling here.
Here is the example code snippet.

&lt;?php
/**
 * Implementation of hook_form_alter().
 * @see http://api.drupal.org/api/function/hook_form_alter
 */
function yourmodule_form_contact_mail_page_alter(&amp;$form, &amp;$form_state, $form_id) {

    if(arg(0) == 'estate' &amp;&amp; is_numeric(arg(1)){
        $node = node_load(arg(1));
    }

}
?&gt;


You can also see how can you customize the contact form here:
http://www.metaltoad.com/blog/how-add-field-drupal-contact-form
http://www.isegura.es/blog/modifying-contact-form-drupal-how-add-field
http://www.pensamientosdivergentes.net/blog/modifying-contact-form-drupal-how-add-field

The drawback of this solution is you have to use the new path "estate/%node" to the node view page instead of using the default existing path "node/%node".
Any better answer is welcome.