Quantcast
Channel: Recent posts across whole site
Viewing all articles
Browse latest Browse all 49237

using webform

$
0
0

I like to use a single contact form that is routed to different expert emails depending on where the user comes from. I also need the form title and intro text needs to be customized. I am using the webform module.

Example: I have a link “talk to expert A” and a second link “talk to expert B”. Both links point to the same form at forms/generic_form.

link A points to forms/generic_form?recipient=expert_a@example.com
link B points to forms/generic_form?recipient=expert_b@example.com

In the form I have set a field “recipient” with a default value of %get[recipient]

In the webform module setup I have checked the recipient email under “Conditional e-mail recipients”

Now I like to add a specific title and some intro text to the form depending on the targeted expert.

I added a webform-form.tpl.php file to my theme. My intention is to inject title and intro text into the node object via template.php. However, webform-form.tpl.php doesn’t make the node object available. It provides only access to the $form array. And the node object only includes the rendered form and unprocessed form, e.g. it will give only "%get[recipient]" as the default value not "recipient=expert_a@example.com"

I like to access the parameter that I have passed in the url (recipient=expert_a@example.com) and use that to generate context specific titles and intro text in template.php.

Sorry for the long explanation but I really would appreciate if a Drupal expert would point me in the right direction.

My question really is: Am I doing this right? If no, what is the right way of approaching this. If yes, how can I get this working?


Viewing all articles
Browse latest Browse all 49237

Latest Images

Trending Articles



Latest Images