Drupal 7에서 노드에 프로그래밍 방식 양식을 추가해야합니다. 노드에 양식을 첨부하는 방법은 무엇입니까?프로그래밍 방식으로 Drupal 7에서 노드에 양식을 추가하는 방법?
function addtabexample_form($node, &$form_state) {
$type = node_type_get_type($node);
$form['title'] = array(
'#type' => 'textfield',
'#title' => check_plain($type->title_label),
'#default_value' => !empty($node->title) ? $node->title : '',
'#required' => TRUE,
'#weight' => -5,
);
$form['field1'] = array(
'#type' => 'textfield',
'#title' => t('Custom field'),
'#default_value' => $node->field1,
'#maxlength' => 127,
);
return $form;
}
아주 간편한 발췌문입니다. 감사. – stefgosselin