Custom form displayed on each instance of node per content-type

Events happening in the community are now at Drupal community events on www.drupal.org.
deepsoulstarfish's picture

I'm looking for a neat solution to this problem.

I have created a content type, and I would like to display a simple form with each instance of a node of that content type.

I would like to pass variables from the node into hidden fields in the form (eg node id or node title). And then a few text fields for user input. The submission would then need to be emailed to the site admin, or nominated email address.

The idea is to allow users book the particular resources by sending their contact details to us, linked to the resource they are interested in:
See
http://www.youthdeved.ie/development_education/youth-future

I've looked at webform but it doesn't seem to suit my needs.
I looked at info on building basic forms but couldn't master the connection between the node and the form.

I'll gladly pay a few hours of consulting time to someone who can talk me through this task.

I can't believe it is apparently so hard to achieve, or am I missing something?

Help really welcome from more advanced drupalistas!
Daniel
PS
I can't make wednesdays, otherwise you might have seen me in the longstone by now!

Comments

Webform

alanburke's picture

Webform will do the trick.

Create your webform, with some hidden fields.
You can prepopulate webforms with arguments from the URL, even hidden fields.
Set the values as default values for the fields.
Craft your link to that webform, and either attach it manually to the node or with hook_link.

For bonus marks,
you could get the webform into a block, and display it below the node.

Yes, webform works

deepsoulstarfish's picture

Spot on Alan, it's amazing how fresh eyes help so much sometimes.

I had gone down the webform track, and missed the fact that I could just use the URL. (I was all obsessed with getting the node id, but the URL meets our needs just as well)

Once again I can put off learning how to code wonderful custom modules!

Clear and straightforward solution, Thanks so much for taking the time to help :-)

Ireland

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: