Hi everyone,
I've messed around with a few options, but I just can't seem to get what I want from this system today.
First let me explain the workflow:
User browses through a few training courses (CCK Nodes, grouped by Views) until they see one they like. Each node has 2 buttons, called "Enquire about this course" and "Book this course". When user clicks one of these buttons, they should be redirected to a contact page with a field like "action" already set to "Booking" or "Enquire", depending on which button they clicked, and another field like "Course" already selected with the course from which they clicked the button.
Now, I've been trying to play with modules like Rules, Tokens and Webform, but none of them seem to do exactly what I need.
The only other option I can think of, is modifying the contact module to look for variables in the querystring (like ?action=booking and ?course=coursename) and if they exist, I can show them on the contact form and submit it.
Would this be a good idea or are there modules out there that can do what I need them to?
Any suggestions would be greatly appreciated!
Comments
Try the Webform and
Try the Webform and Prepopulate modules.
I assume you can already generate the relevant "Enquiry" and "Booking" buttons, so using Prepopulate shouldn't be any different (except maybe the exact form element names to pass values to).
I'm also making the assumption that Prepopulate works with Webform ... it should .. as it hooks into the Forms API ... but I've never tried that exact combination of modules before.
Good luck.
Nope
That also didn't do exactly what I needed it to.
I ended up using the standard link CCK field.
Then I made default values that redirected it to the contact page with standard token parameters, like so:
URL:
contact/enquire/[nid]
or
contact/book/[nid]
This then redirected to my own copy of the contact module which I modified to take apart that querystring and populate two new fields with the acion Type (Enquiry or Booking) and the name of the course, extracted with a SQL query based on the node id.
Wasn't simple, but wasn't hard either.