/ Published in: PHP
A form alter implementation to create variables to flag certain features per node type. E.g. Show foo on blogs only: example_blog == 1;
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Implementation of form_alter */ function example_form_alter($form_id, &$form) { if ($form['type']['#value'] .'_node_settings' == $form_id) { $type = $form['type']['#value']; '#title' => t(''), '#type' => 'fieldset', ); '#title' => t('Type has XXX'), '#type' => 'checkbox', '#default_value' => variable_get('example_'. $type, 0), '#description' => t(''), ); } } }