Has anyone created a web form using the module webform and port it to a block using Node as Block?

I have tried this, but it displays the description twice. Is there a way around this or am I stuck with finding another way for collecting emails for an opt-in list. This is the closest thing I have found to work in Drupal. Does anybody else have any suggestions?

Thanks in advance.

fet

Comments

Rowanw’s picture

I've used the following code in a block without much hassle. Just make sure you change the 'url_of_my_webform' part.

<?php
if (module_exists('path')) {
  $alias = drupal_get_normal_path('url_of_my_webform');
  if ($alias != $_GET['q']) {
    $path_part = explode('/', $alias);
    print node_view(node_load($path_part[1]), FALSE, TRUE);
  }
}
?>

I got this snippet from somewhere else on drupal.org.