Skip to content

Instantly share code, notes, and snippets.

@makbeta
Created August 20, 2013 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makbeta/6284728 to your computer and use it in GitHub Desktop.
Save makbeta/6284728 to your computer and use it in GitHub Desktop.
Drupal7: embed site contact form in the node template
<?php
//render site contact form on the contact-us page [put this code in your node.tpl.php where you want the form to appear]
if($node->nid == 4) {
require_once drupal_get_path('module', 'contact') .'/contact.pages.inc';
$contact_form = drupal_get_form('contact_site_form');
print drupal_render($contact_form);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment