0

Actually in hook nodeapi(op:presave) I'm setting my own custom title so I want to hide the title field from the node edit form.

It does not work if I use automatic nodetitle module since it is also changing the title.

What is the best way to hide the title without using automatic nodetitle module?

2

Use hook_form_alter and unset($form['title']) in a custom module (since the node create / edit form will usually be displayed in your admin theme this will be a better approach than adding the function to your themes template.php file.

So create a module with a basic mymodule.info file.

Create a mymodule.module file and add:

function mymodule_form_alter(&$form, $form_state, $form_id) {

   // 1.NODE TYPE FORM
   if ($form_id == 'NODE_CONTENT_TYPE_node_form') {
     unset($form['title'];
   }

 }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.