I had created a custom contact form in Drupal 6, where I included a custom block on the page with the following php code:
<?php if(!function_exists('contact_site_page')) { include_once(drupal_get_path('module','contact').'/contact.pages.inc'); } print drupal_get_form('contact_mail_page'); ?>
This works fine.
I now try to do the same in Drupal 7, and customized the code as below:
<?php if(!function_exists('contact_site_form')) { include_once(drupal_get_path('module','contact').'/contact.pages.inc'); } print drupal_get_form('contact_site_form'); ?>
The "contact_mail_page"
I think I enabled all necessary modules / set permissions: admin/modules Enable Contact module Enable PHP filter module
admin/people/permissions Enable Site wide contact form for all users Filter -> Allow PHP text format
All I get as output is "Array", which means I am missing something here (I suspect strongly that the contents of that array, if it would get displayed, is exactly what I want). Any ideas?
Thanks, Ursula
Solve it: In Drupal 7:
print drupal_render(drupal_get_form('contact_site_form'));
Works fine, now.
Ursula
On Sat, Jan 29, 2011 at 2:17 PM, Ursula Pieper dramamezzo@gmail.com wrote:
I had created a custom contact form in Drupal 6, where I included a custom block on the page with the following php code:
<?php if(!function_exists('contact_site_page')) { include_once(drupal_get_path('module','contact').'/contact.pages.inc'); } print drupal_get_form('contact_mail_page'); ?>
This works fine.
I now try to do the same in Drupal 7, and customized the code as below:
<?php if(!function_exists('contact_site_form')) { include_once(drupal_get_path('module','contact').'/contact.pages.inc'); } print drupal_get_form('contact_site_form'); ?>
The "contact_mail_page"
I think I enabled all necessary modules / set permissions: admin/modules Enable Contact module Enable PHP filter module
admin/people/permissions Enable Site wide contact form for all users Filter -> Allow PHP text format
All I get as output is "Array", which means I am missing something here (I suspect strongly that the contents of that array, if it would get displayed, is exactly what I want). Any ideas?
Thanks, Ursula