By robdinardo on
I am using the latest (6.x-2.1.3) version of Webform, but cannot seem to get webform-form-[node-id].tpl.php to work. Can anyone provide an example of a custom webform-form-[node-id].tpl.php ? I guess I am having trouble with the syntax as to how to extract the individual form components from the $form['submitted'] array. Any help would be appreciated, but an example would be fantastic!
Comments
I just need to place the
I just need to place the form elements in a table. There has to be a simple one-liner for each form element right?
Figured it out
it is simple. Not sure what was wrong with my brain. But here is an example that works.
you must have these fields defined in the webform to begin with.
webform-form-[node-id].tpl.php ? where to put
hi should we need to put in theme folder or in module ..
Thanks!
Thanks. I've been trying to figure out what the variable was...Funny thing is I got half of the solution...so close...Oh well. (print drupal_render($form['submit']); works for the submit button for me btw...that's what through me off)
All your template files should be put into your theme folder -- easier to find that way.
Now the question of the new year:
Why is it drupal_render($form['submitted']['variable_name']? instead of drupal_render($form['variable_name']); like most of the tutorials out there have?
How do I define the $body?
Using the example webform.tpl.php example above, how would I define the $body?
i.e.;
I simply can't figure out how to do it in a way that works. Help!
OK, found the answer to my question:
However, can't drupal_render that, so the body will show up twice on the form if I try and use it. So, now what?
Found the answer
You use webform-form.tpl.php to theme the form. However, to theme the node display, you use node-webform.tpl.php.
sub ....
sub ....
-- Sree --
IRC Nick: sreeveturi