Drupal - How To Create A Double Contact Form Page

Just a quick tip here:
If you want to create a double contact form page, like my own contact page, it's easy enough to do:

  • Step 1
    Use the webform module to create the two contact forms. Webform allows you a great degree of customisation over forms and, crucially, it creates its webforms as nodes. This will be important for step two.
  • Step 2
    Now we have the webform contact forms as nodes we can use the panels module and position both of our nodes on the same overall page. To do so, create a new panel (admin/build/panels/add) and choose the default two column layout. Then just place the first webform node in the left hand side and the second webform node in the right hand side.

--------------------------
UPDATE:
This tip was done using Panels v1.
If you are using Panels v2 please check out comment #3 below as it's a little different.

11 comments

1 Jonathan Bloom July 11th 2008 @ 4:51am

I'm having trouble with this! I'm using webform and panels 2 and I can't seem to select webform nodes as content in my panels. I'm using Drupal 5 and the latest of both modules.

2 Laurence July 11th 2008 @ 12:11pm

Hi Jonathan,
I should have mentioned that I was using Panels 5.x-1.2 not 2, so I'll check this out with Panels 2 and post back shortly.

3 Laurence July 11th 2008 @ 1:05pm

UPDATE:

OK, I've checked this out using panels 5.x-2.0-beta5, webform 5.x-1.2 and Drupal 5.8 and it does work fine.

In order to add the webform nodes to the panel:

  • navigate to the panel's 'Content' tab
  • click the 'add to pane' button (plus sign) on one of the panel's panes, which will open the 'Add Content' window
  • in the 'Add Content' window go to the 'Content' section and click on 'Node Content'. This will bring up the 'Configure Node Content' window where you can search for the node you want to add with either its name or node id.

Jonathan, my guess is that you aren't able to see the 'Node Content' option under 'Content' in the 'Add Content' window - correct? If so, you will need to also enable Panels 2's 'Legacy node panes' module from your site's main admin modules section (admin/build/modules).

Don't worry that it says it is 'deprecated'. Looking at this recent issue it seems that the description is now being re-worded due to causing confusion!

Hope that helps you out.

4 Jonathan Bloom July 11th 2008 @ 4:02pm

Thanks, this fixed my problem! Now webform is even more useful!

5 Jurgen July 14th 2008 @ 4:47pm

Hi,

I am also using Panels in combo with Webform module. It all works fine until I submit my webform and then it gets out of the panel and so it also gets out of my layout, my css won't match anymore.

link: www.kscandy.be/nl/contact

Any tips?

Thank you in advance.
Jurgen

6 Guest November 12th 2008 @ 3:10pm

Hi Laurence,
I try to follow what you said, under Drupal 6.6, Panel 6.x-2.0-alpha2 .
I am able to go to 'Configure Node Content', but don't see any way to do what you said,
"you can search for the node you want to add with either its name or node id. "

Any idea?

Thanks,

Simon Chen

7 j0rd January 29th 2009 @ 12:22pm

I have the same problem as post #5.

I'm using Drupal 6 and Panels 2

I create panel page and add my webform node on it. Then when I submit the webform (lets say it's node 41), it redirects to the "/node/41" page, instead of the path I have for my panel.

I've attempted to change $form_state['redirect'] in the webforms advanced settings for post validation and post-processing. it didn't work.

I changed the "confirmation message or URL redirect" to internal:contact_pane and that resolved the problems for successful submissions, but not failure.

If anyone knows how to resolve this issue, please post it here.

8 Gökova March 23rd 2009 @ 7:25pm

ill try that... thnx

9 Guest April 14th 2009 @ 12:50pm

This is amazing

10 Audy May 7th 2009 @ 4:02pm

Really useful. This entry give me inspiration.

Thanks.

11 Spongs July 31st 2009 @ 7:10pm

RE: If your form is redirecting to the wrong page after the validation has failed etc

I just created some URL aliases (administer>site building>URL aliases) so for example my content/feedback url would point to ?q=contact. Therefore the submission goes back to the page from where it came.

Regards.

Comments are closed

If you want to ask a question or have something to add please contact me.