Hi all,
How can I change node title after editing a form?
I use hook_nodeapi and:

$node->title = 'something';

but it doesn't work/
thanks in advance

Comments

johnpitcairn’s picture

What $op are you responding to in hook_nodeapi?

Hamid.D’s picture

if($op == 'update'){
  $node->title = 'something';
}
Biffen’s picture

You want to alter the title before it is saved, right?

In that case, you should respond to 'presave'.

duckzland’s picture

try drupal_set_title()

--------------------------------------------------------------------------------------------------------
if you can use drupal why use others?
VicTheme.com

alexmoreno’s picture

it will not work because you need to save your node:

node_save(node_submit($node));