Download & Extend

Allow developers to adjust webform block default settings

Project:Webform
Version:7.x-3.18
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

We use hook_webform_node_defaults_alter() to adjust the default settings for webforms and love it. However, we also needed a way to alter the default block settings for a webform (the display_block and view mode settings).

The following patch uses the same convention you are using for the node settings for the block settings, which then allows us to create the following hook:

function custom_module_webform_block_defaults_alter(&$defaults) {
  $defaults['pages_block'] = '1';
  $defaults['display'] = 'full';
}
AttachmentSize
webform_block_defaults.patch921 bytes

Comments

#1

Status:active» needs review

Revised patch also updates webform_block_view() to rely on the webform_block_defaults() method.

AttachmentSize
webform_block_defaults.patch 1.37 KB
nobody click here