Uncoke
Uncoke

Reputation: 1902

Drupal webform into front page template

I need to add a webform to my page-home.tpl but I'm really new on Drupal so I need a really clear help...

I'm using DRUPAL 6 and I have created the webform.

I would like to add the webform to my custom template just adding the php code to the tpl file. My webform id is id="webform-client-form-20".

Can you help me ?

Thanks a lot

Upvotes: 1

Views: 868

Answers (1)

Clive
Clive

Reputation: 36956

The quickest (not necessarily best) way to do it is using a combination of node_view() and node_load():

$nid = 20; // Node ID of the webform.
$webform_node = node_load($nid);
echo node_view($webform_node);

You'd be better off loading that into a variable in a preprocess function than outputting it directly in the theme but this should work for your purposes.

Upvotes: 1

Related Questions