Closed (fixed)
Project:
Webform
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Mar 2008 at 04:29 UTC
Updated:
17 Jun 2017 at 12:16 UTC
Jump to comment: Most recent
Comments
Comment #1
andrabr commentedThe following seems to work Ok:
Comment #2
quicksketchYou have to pass in all the form parameters. I've included them all here as variables for a clear example.
Comment #3
andrabr commentedThank you!
Since drupal_get_form is poorly documented, let me try to impose on your patience once again:
In your example,
1) where does the value of $node come from?
2) What is the purpose of $submission? does it need to be pre-populated?
3) What is $enabled for?
I do not mean to hog your time, but i have searched and searched and found only questions. A couple of relevant links would go a long way (yes, i have been reading up on Forms API, but failed to find the answer)
Many thanks in advance
Andrey
Comment #4
quicksketchYou should read the PHP Doc for webform_client_form() where each of the parameters is documented (or should be :P). We probably could set defaults for most of the parameters, but I haven't seen many people calling drupal_get_form() to get a webform directly.
The $node object is the node containing the webform. If you don't have it already you can load the webform like this:
Comment #5
andrabr commentedThx!
Comment #6
rv0 commentedIn drupal 7
did not work
this does...
Comment #7
goldhat commentedIs there any advantage to this rather than making the Webform available as a block, and then embedding the block in your node template?
Comment #8
rv0 commented@goldhat
in my case i needed the webform in a ctools modal frame.
was "easier" this way.
Comment #9
dobe commentedIn drupal 6 this is what worked for me:
Where XXX is the node id.
Comment #10
waspper commented... And works Ok on Drupal 7
Comment #11
SimonRain commentedI have a solution that outputs the same html as working example in your post @rv()
I was working on a similar problem but I had to return the form in a JSON object to be displayed in a web app.
then you can print the
$node_renderedor return it inside of a JSON objectComment #12
asauterChicago commentedOld posts, but this comes up high in Google. So if anyone else is looking to embed a webform in views on Drupal 7, number 9 actually works in getting the form to pull up in a views footer. I tried all the other posts in here and post #9 in here was the only one that worked.
Comment #13
prsnjtbarman commentedComment #14
marc delay commentedYou don't need the submission or enabled parts, In fact those are no longer the proper arguments for the function. (In this case they won't really hurt anything, but it will add confusion.)
Comment #15
aegirone commented#14 It doesn't work :( .