I am in need to theme webform in D7.
How can I do that ?
In the search I've come to know that by using web-form-nid.tpl.php we are able to theme a drupal individual form.
Could any one guide me in this case to theme a webform.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI am in need to theme webform in D7.
How can I do that ?
In the search I've come to know that by using web-form-nid.tpl.php we are able to theme a drupal individual form.
Could any one guide me in this case to theme a webform.
You can theme a individual webform using webform-form-nid.tpl.php
.
For example if our webform node id is 7 , create a template file namely webform-form-7.tpl.php
and place it in your theme folder. Clear site cache.
Do a print_r($form);
to see all the elements. Then render each elements in file within your html elements.
<li>
<?php print drupal_render($form['submitted']['name']); ?>
</li>
As @Patrick Kenny said read the theming.txt, it explain all aspects of theming a webform
If you know the .tpl.php filename, here is what you do:
<pre><?php print_r(get_defined_vars()); ?></pre>
in your template.