Hi,

I'm working on a property website. I plan to use a custom (CCK) node which displays info about each property. On each property page/node I want to be able to include a link to a webform (webform module) for people to make an enquiry about the property. These enquiries would then be emailed to the website owner including details of the relevant property.

Does anyone know how I can pass the property node ID to the form so the property details are included in the enquiry?

Thanks in advance.

Comments

Christefano-oldaccount’s picture

Add a CCK nodereference field to the webform content type.

limehouse’s picture

Thanks for replying. I've done what you said, but don't know what to do next. Please can you point me in the right direction? (not a PHP or Drupal expert!)

Thanks again

Christefano-oldaccount’s picture

Sorry for not being more helpful earlier. I think I was on the way out the door when I saw your post.

To create a CCK nodereference, select the property node after choosing Add field -> Node Reference. If you make it mandatory, then the property node reference will always be included in the form output when the form is filled out (and emailed) to the site owner.

Does this make sense? What happens when your webform is filled out right now?

limehouse’s picture

I appreciate you taking the time to respond. As you can tell by my delay in replying, I've been a bit busy myself past couple of days!

I've followed your instructions, but sure not properly. Would you mind me dropping you some more replies when I'm working on the site this weekend? No problem if not. And thanks a lot for pointing me in the right direction... Cheers

Christefano-oldaccount’s picture

I'm not sure why it's not working. I'm all for it if others are able to help here in the forum. In the meantime I'll contact you privately.

gatman’s picture

I have same scenario as original post.

I have created a content type (the Listing) and I have created a simple form (webform). In this webform I have included a field with a default value "%get[title]".

In the Listing I created a new field using Node Reference = > Select List. This field is required and references the web form I created earlier.

This is a test so I am not trying to hide the user's choice or the value. However I do not see the value in the form and when reviewed with the Dev module, I don't see the value either.

Sorry of this is addressed somewhere but I have click through nearly 50 pages of search results and the handbook.

Must be something I am over looking.

Many many thanks in advance!

John

deepsoulstarfish’s picture

Just wondering if the original poster found a fix for this.

I can't believe it is so hard to:

* Insert a webform as a block listed with every node instance of a content type (say "joblisting")

* put the node id for each "joblisting" into its attached webform.

I would really appreciate help with this solution

;-)
Daniel

richH’s picture

Hi,

I'm also struggling now for a day with what I hope is the same problem. I have an Event which has some dates etc and I want to allow visitors to book this event using a webform.

So one solution is to create a link such as ....book/?from=12.8.2011&to=14.8.2011..... etc and then use the %get to reference these variables.

But this makes ugly URLs and doesn't seem to be correct for Drupal which is normally so slick.

I've tried the node reference module and watched the video on http://mustardseedmedia.com/podcast/episode37 but this just takes me to a page which creates a new webform instead of entering data into an existing webform.

All I can find is lots of similar questions (even from 2008) but no answers!

Thanks
Rich

limehouse’s picture

Hi,

I am the OP. I couldn't get nodereference to work for me.

There are a couple of options however that did:

1. Install the Custom Links module.
Configure the module by entering the path to your webform and the relevant token in the querystring field (e.g., title=[title]). Then add the Custom Links block to all the relevant node pages via Panels. Then use %get in webform.

OR

2. Install the Contemplate Module
Add a link to the webform in the relevant content type body (e.g., <a href="/contact-form?title=<?php print $node->title; ?>Link to webform</a>. Then use %get in webform.

Hope this helps in your case.