Hey,

I am creating pages for people, and want to have a contact page at the bottom of their page.

I see contact form module to allow me to add multiple ones, but is there any where I can make the contact form available on an actual page?

Comments

jim0203’s picture

Can you put the contact form node into a block by using Panels, and then put the block onto the page?

Schwallie’s picture

I would only want it in a couple specific pages, and I wouldn't know how to put a contact into a node either, I know how to create them as pages, but I don't see how to create them in content or in existing pages..

Thanks a lot for the help fyi :) I forgot to thank in advance before lol

jim0203’s picture

Just tried it in panels, and it didn't work as I'd like it to. So, have a look at

http://drupal.org/node/166432

And scroll down to the last comment.

Schwallie’s picture

Hey!

Thanks a lot :)

Now how would I do individual contact pages?

Basically, I am doing a contact page for a list of individuals on my website. They each get their own individual pages they can customize. I want a contact at the bottom for them where they can get contacted(and also an e-mail sent to myself). So if I set up a contact form from contacts, what would I change to make it their personal one?

sorry for being dense lol

jim0203’s picture

So you (and anyone else following this) doesn't have to flick between two threads, here's the PHP to display the sitewide contact form in a block:

if(!function_exists('contact_site_page')) {
  include_once(drupal_get_path('module','contact').'/contact.pages.inc');
}
// (attention !) contact module must be enabled
print drupal_get_form('contact_mail_page');

It seems that Drupal provides another function called contact_user_page: http://api.drupal.org/api/function/contact_user_page/6. I think this deals with the various personal contact pages.

Similarly, instead of the last line in the code above, there's a function called contact_mail_user: http://api.drupal.org/api/function/contact_mail_user/6. So try rewriting the above as:

if(!function_exists('contact_user_page')) {
  include_once(drupal_get_path('module','contact').'/contact.pages.inc');
}
// (attention !) contact module must be enabled
print drupal_get_form('contact_mail_user');

The fly in the ointment is that contact_mail_user has two parameters - the second one of which defines which user the form is being called for (see http://api.drupal.org/api/function/contact_mail_user/6). You'll have to supply this parameter in order to call the correct user contact form.