Search code examples
drupal-7drupal-modules

drupal 7 include site wide contact form in a node


I want add the Site Wide user form a node.

I used Drupal 7.

The site wide form Id-s: contact_site_form ( I get it from from.inc )

With alter I altered the form content.

in the node code:

php code:

print drupal_render(drupal_get_form('contact_site_form'));

Error message:

Notice: Undefined index: contact_site_form drupal_retrieve_form() függvényben (D:\wamp\www\online_recruitment\includes\form.inc 766 sor).
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'contact_site_form' was given drupal_retrieve_form() függvényben (D:\wamp\www\online_recruitment\includes\form.inc 802 sor).

Solution

  • I found the answer:

    http://drupal.org/node/237559#comment-780448 -> D6 way but worked in D7 as wel

    php: require_once drupal_get_path('module', 'contact') .'/contact.pages.inc';

    it worked like a charm.