can a webform be in a block?
rs7272 - April 25, 2007 - 18:42
Other than copy and past the code from a webform, is there a way to make it a block. For example, I want a form to always be in the left column of my site and if I change the webform I would like it to update in the left column automatically rather than having to copy/paste the code from the form page to the block. Certainly not a showstopper, but I'm lazy :)
thanks

if it's important...
If anyone cares, the site I'm wanting to add this to is www.lawinfonet.net - they want the form to be on the left column (with all the other business...) Again, I have done that before by copy paste, but I want them to be able to change the webform if needed and have it update in the block, not just the actual webform page.
Nodeasblock Module is
Nodeasblock Module is perhaps what you're looking for.
- p6
www.bas.org.in
I tried to use nodeasblock
I tried to use nodeasblock with webform and unfortunately, the actual form doesn't display in the block form. Only the title and description.
Oh well.
One Possible Solution
Using the Views module, create a block that displays the single full node for the webform.
Views+webform
Superb! That works a treat for me!
It may not work and pasting the form is likely to fail
I have not used webform but there are some issues you should be aware of. The first is to see how the action is set, it normally defaults to the page being viewed and in the case of placing a form in a block this would be incorrect. Modules like the search module set the action so they will work in a block. A quick check shows action not being set by the webform module so this would be an issue.
And cutting and pasting a form will generally not work in Drupal as it does security checks to avoid unwanted postings but it generally means forms not generated with the forms API will not work. And while the original form is produced by the form API, there are parts of the form data that are dynamic and "expire" after a certain amount of time.
Pasting does work...
After I make or update the webform, I can view source and copy / paste it in a block and it works fine, but they want to be able to update the webform and have it be updated in the block too without having to copy paste - it will be rare if ever that they make changes anyway...
The views solution works,
The views solution works, I'm using it now, and that's the only way I managed to work around that bug.
Idan
Using views worked for me too.
I just wish I found this two weeks ago...
Views in Drupal 6.x
Views thus far in Drupal 6.x show the teaser, but not the form part itself. Any workarounds?
Use the node_view function
I created a new block with the input format as PHP and used this code to get it to work:
<?phpprint node_view(node_load($nid), $teaser = FALSE, $page = FALSE, $links = TRUE);
?>
Use the node_view function
Worked well for me, thanks!