I entered the post below on a closed issue,so I don't know if it may not get looked at, and therefore I'm re-posting it as a new issue:
Hello,
I just put this code:
$node = node_load(10); // Change to whatever the nid of your webform node is
print node_view($node, FALSE, FALSE, FALSE);
on my site to put a webform in a block on the left hand side, and it shows up all the text of the page / form, but none of the fields or submit buttons.
I really need to put the webform in a block. I don't know if this is a feature request already or not, but it'll be really nice to be able to take any webform and put it in a block. The nodeasblock module doesn't work for webform nodes. You get similar results to the above, except you get less info displayed.
Please see http://www.internetmarketing4realestate.com/test. The top block on the left hand side is what nodeasblock gives me and the bottom block on the left hand side is what the code above gives me.
I know I can just create the forms manually inside of a block, but what fun would that be? Also, I'd have to code in all the good stuff that comes with webform such as form disposition and spam control. I would imagine this would be very useful to a lot of people and I'm surprised that I haven't been able to find more info on this in drupal.org, though I've looked quite a bit.
Thanks in advance
Comments
Comment #1
skhatri commentedAnybody? A solution to this problem may be quite valuable to a number of people, not just me.
Thanks.
Comment #2
elly commentedYep, I need a solution to this too. Help!
Comment #3
elly commentedps. i hacked around this by cutting and pasting the form code from the webform (view source) into a block. works great.
Comment #4
harro commentedHi!
I tried the same thing (copy-pasting the source), but the form-action submits to itself. When I submit, the form data does not get written to the database... I guess it requires some extra PHP code for that (which doesn't show in the source). Can you tell me how you fixed that?
Thank you!
Harro
Comment #5
quicksketchThis problem was fixed in the 1.3 release. We now support multiple webforms on a single page, such as displaying a block on a page.
Comment #6
(not verified) commentedComment #7
arbel commentedHello,
I just downloaded the latest webforms and I get the same problem, I made the webform in a block and placed it on the main page, and instead of the form I get the description line twice.
Idan