Webforms can be used in a block. (Webform 7.x-4.x)
- Create your webform in a node.
- Edit the node.
- Select the Webform tab.
- Select the Forms settings tab.
- Select Advanced settings.
- Check [ ] Available as block.
- Save configuration.
Your webform is now available both as a content node and a block. You can hide the node or use it however you want. In particular, you can suppress the display of the form on the node detail page under Manage Display for that content type.
Look in the blocks list for the block. If you named your webform Example form, the block will be named Webform: Example form.
The block gives you the following choices.
- Form only
- Full node
Form only is typically used to avoid duplicating the node's title (in addition to the block's title) and any other node fields which are set to display in the selected view mode.
- Display all pages inside block
- Redirect to the node page after the first page
- Display as configured in the webform
- Display the confirmation page in the block on the same page (no redirect)
When the confirmation message is configured to be shown in the block and the webform's redirect is set to the confirmation page, the block is replaced with the confirmation page. Otherwise, the confirmation message is added to the beginning of the block, ahead of the form, styled as if it were a standard Drupal status message.