Hi
I am using 4.7.0-beta3 and I want to add another textfield to other nodes, say "page", then add to the edit form and save it into a table I created. I think it should be pretty simple but I've missed something and would really appreciate an expert looking over it quickly - should be obvious.
I use nodeapi and form_alter hooks as I understand it - the field I want is a syllabus field for a page so I have done the following:
function fhsstadmin_form_alter($form_id, &$form) {
if (isset($form['type'])) {
$node = $form['#node'];
if ($form['type']['#value'] .'_node_settings' == $form_id) {
$form['fhsstadmin'] = array('#type' => 'fieldset', '#title' => t('Syllabus'));
$form['fhsstadmin']['fhsstadmin_options_'. $form['type']['#value']] = array(
'#type' => 'radios',
'#title' => t('Syllabus'),
'#default_value' => variable_get('fhsstadmin_options_'. $form['type']['#value'], 1),
'#options' => array(t('Disabled'), t('Enabled')),
'#description' => t('Choose whether syllabus should be shown or not.')
);
}
if ($form['type']['#value'] .'_node_form' == $form_id && variable_get('fhsstadmin_options_'. $node->type, 1)) {
$form['fhsstadmin_syllabus'] = array(
'#type' => 'textarea',
'#title' => t('Syllabus'),
'#default_value' => $node->syllabus,
'#cols' => 60,