简体   繁体   English

Drupal:将联系表单作为字段添加到用户个人资料

[英]Drupal: add contact form as field to user profile

Drupal allows you to create additional fields for user profile pages that can be publically accessible (anonymous user). Drupal允许您为可以公开访问(匿名用户)的用户个人资料页面创建其他字段。 I would like to add a contact form on each user´s profile page. 我想在每个用户的个人资料页面上添加联系表格。 I know that each user already has a contact page, but I want to have a contact form that´s embedded on the http://localhost/users/foobar page. 我知道每个用户已经有一个联系页面,但是我想在http:// localhost / users / foobar页面上嵌入一个联系表单。

Maybe there is a module that adds a field type to profiles? 也许有一个模块可以向配置文件添加字段类型? Or maybe you can use a form creation module that also allows you to diplay the form on the user profile page? 或者,也许您可​​以使用表单创建模块,该模块还允许您在用户个人资料页面上显示表单?

I´m running Drupal 6.14 and i´m using these modules: 我正在运行Drupal 6.14,并且正在使用以下模块:

admin_menu        ctools  filefield   jquery_ui  pathauto          vcard
auto_nodetitle    date    imageapi    jump       taxonomy_manager  views
cck               devel   imagecache  link       token             webform
content_taxonomy  email   imagefield  panels     transliteration

In your theme, extend the default user-profile.tpl.php with the following code: 在您的主题中,使用以下代码扩展默认的user-profile.tpl.php

<?php 
print drupal_get_form('contact_mail_user', $account);
?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM