Article

Drupal 7: How to insert or embed a webform and block into a node or content type

How to insert or embed a webform as a field display or block into a node or content type in Drupal 7

To insert or embed a webform, whether as a block, field display or another webform node in any content item node without any coding, any of the following options can work:

Entity Reference

  • Install and enable entity reference
  • Under Manage Fields, create a field as an entity reference type
  • Under Entity Selection, choose Simple, then check/select on Webform
  • Under Manage Display, select format Rendered Entity
  • Create your Webform (Add Content Item), then save
  • Create your Content Item (where the webform node will be inserted), then select the webform from the dropdown list provided by the entity reference field

 

Webform Enable Per Content Type

  • Edit your content type, then enable Webform

     
  • Create or Edit your Content Item (Webform tab is now available)

     
  • Click on the Webform tab, then create and save your webform node 

 

Insert Block

(less recommended due to known security issues)

  • Install and enable Insert Block module
  • Create your Webform node
  • Under Advanced settings enable webform as a block
  • Before you can use the insert block functionality, you have to enable or allow this for your editor by going to Text Formats > Full or Advanced > Configure > Enable Filters > select to enable Insert blocks
  • Create / Edit your content item, then for example to insert the webform block within the Body field, use the shortcode format as provided by the module

    [block:name of module=delta of block]

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.