I will use this module first for the contact forms. Its main usage will be as a block displayed on every page in the footer section.

Is it possible to add an option for displaying the whole block, not only the teaser?
Because i need the form to be displayed entirely.

Thank you very much:)

Comments

quicksketch’s picture

Category: feature » support

Try the following:

1) Create new block
2) Set the input format to PHP
3) Enter the following code:

$node = node_load(10); // Change to whatever the nid of your webform node is
print node_view($node, FALSE, FALSE, FALSE);

4) Show on every page (the default)

That's it! If you'd like more info on the code, check the API site on node_load and node_view.

mishhh’s picture

Thank you very much for your help:)

An other alternative may be nodeasblock module (for anyone reading this)

BioALIEN’s picture

This is a very helpful snippet. I am collecting as much of this info as I can so I can create the documentation for this module :)

quicksketch’s picture

Status: Active » Closed (fixed)

This isn't really directly related to this module, but hey: the more the merrier!

hectorplus’s picture

Wow, neat code, i must say! Just what i was redirected to.

BioALIEN’s picture

Yeah, quicksketch can really kick ass sometimes with his posts :)

skhatri’s picture

Hello,

I just put this code:

$node = node_load(10); // Change to whatever the nid of your webform node is
print node_view($node, FALSE, FALSE, FALSE);

on my site to put a webform in a block on the left hand side, and it shows up all the text of the page / form, but none of the fields or submit buttons.

I really need to put the webform in a block. I don't know if this is a feature request already or not, but it'll be really nice to be able to take any webform and put it in a block. The nodeasblock module doesn't work for webform nodes. You get similar results to the above, except you get less info displayed.

Please see http://www.internetmarketing4realestate.com/test. The top block on the left hand side is what nodeasblock gives me and the bottom block on the left hand side is what the code above gives me.

I know I can just create the forms manually inside of a block, but what fun would that be? Also, I'd have to code in all the good stuff that comes with webform such as form disposition and spam control. I would imagine this would be very useful to a lot of people and I'm surprised that I haven't been able to find more info on this in drupal.org, though I've looked quite a bit.

Thanks in advance