Hi there Drupal Experts!

I'm really stumped on the best way to do this...

Imagine an appointment-based business like a hair salon, which offers a whole bunch of services. A service might consist of a name, category, description, time allotment, regular price, and sale price. So I build a full-node view that lists all the services in a category. (That's the easy part!)

But beside each service, I want a "request an appointment" link, pointing to a "Request an Appointment" form (using the webforms module). On that form, the "Service" field should be pre-populated with the name of the service the user just clicked.

Once in the webform, I think I'm in good shape -- I can use %get[service]. It's getting that value in the URL that I'm struggling with!

Obviously I'm looking for a low-code, all-admin solution. But would it be better to build a custom page for the service view, hardcode the link to the webform, and append the name of the service to the URL? If so, what might that look like?

Thanks in advance for any help you can provide. All the best,
Dave

Comments

tordrup’s picture

Anyone?

--
Cooper Web Design
www.cooperwebdesign.ca

maulwuff’s picture

I am dealing with a similar problem right now. With your tips I managed to do this:

In my webform I have added a readonly textfield whichs default value is %get[eventname]
on a node I have put this link:
http://localhost/drupal/?q=node/4&eventname=testevent

When I click it, the eventname is written in the textfield.

So far your post sounded like a howto for me :)

I also thought about the other way round: create nodes for events, categorized with a certain taxonomy. The nodes titles in this category should be select values on the webform. This way, the would be no manipulable get parameter. But I've got no clue how to do that so far.