0
我想學習drupal,所以現在我的網站駐留在本地主機上。我使用DRUPAL 7.我一直在使用Drupal的聯繫人模塊創建一個聯繫我們頁面在我的Drupal網站。我想再添加一個字段(電話號碼)到現有的聯繫表單,並且需要將該值和電子郵件一起發送。怎麼可能做這樣的事情。在drupal的默認聯繫表中添加其他字段
我用下面的代碼在我的聯繫人模塊頁面
function mymodulename_form_contact_site_form_alter(&$form, &$form_state) {
$form['phone'] = array(
'#title' => t('Phone'),
'#type' => 'textfield',
'#required' => TRUE,
);
$order = array(
'name',
'mail',
'phone',
'subject',
'cid',
'message',
'copy',
'submit'
);
foreach ($order as $key => $field) {
// Set/Reset the field's
// weight to the array key value
// from our order array.
$form[$field]['#weight'] = $key;
}
}
但現場沒有顯示在網站的頁面上了。請幫忙。
謝謝
我通過創建一個新模塊並將相似的代碼放在那裏來實現它。謝謝。 – BIJU