Drupal - How to show webform as block

Special thanks to Peacog Web Development for their great tutorial .Here is the tip:

Rather than Drupal 7, Different Block types can be created by admin

so the solution is simple :

  • Create a new block type using : admin/structure/block/block-content/types
  • Add a Reference of type Webform to custom block type
  • remove body if it's inappropriate
  • modify custom block Manage Display so the form would be rendered as webform
  • your new Block type is ready

now to add any new webform as block you, you will need to add new block of type Custom Block and refer to your webform, and that's done.


logeshvaran is correct: Webform for Drupal 8 already provides a block that can reference a webform. So no need to create a custom block type.


From Drupal 8 admin

  1. Create your webform
  2. Structure => Block Layout => click "Place Block" under your preferred region
  3. Find Webform then => Place Block => under Webform type your webform title and it will find it
  4. Save Block

You are all set

Tags:

Webforms

8

Blocks