How do I customize a create content form for a certain content type. In this instance I have a CCK type, of Products but every time I create a product I use 4 fields Name, Price, Picture and dimensions.
Is there a way to slim down the create content form to just have these options? Is this what Contemplate does?
You'll want to use the hook_form_alter hook.
In Drupal 6, I use this to hide most of the extraneous stuff in the node edit/add form.
function mymodule_form_alter(&$form, $form_state, $form_id) {
// hide extraneous options in the node form for nodetype nodes
if($form_id == 'nodetype_node_form') {
$form['path']['#access'] = FALSE;
$form['menu']['#access'] = FALSE;
$form['author']['#access'] = FALSE;
$form['options']['#access'] = FALSE;
$form['comment_settings']['#access'] = FALSE;
$form['revision_information']['#access'] = FALSE;
}
}
Contemplate is for styling the node view, not the node form. I advise against it - it's far better to use node-nodetype.tpl.php files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With