In Drupal 6, there is a known limitation in Autonode Titles, that NID and taxonomy terms cannot be used as autonode title tokens for node names. On node creating these elements are not assigned when the node is saved, therefore they return empty values, and the name of you node is empty.
The workaround is to use the Rules Module. We create a rule that is triggered whenever new content is created. This new rule just fires off autonode title for the node, then saves the node. The process just saves the node a second time, and creates the correct node title since the Node ID and taxonomy terms then exist for the node.
Here's how to create your Resaving Rule:
- Install the Rules module on your site, run update.php.
- Enable Rules, and enable Rules Administration UI, so you can make rules.
- Now add a new rule, and name your rule.
- Set the event that triggers the rule to "After saving new content".
- Save the changes of the rules settings.
- Now you can add a condition to the rule. I only want this rule to apply to one content type, since I don't need if to be executed for all new content. Add the condition "Content has type", and select the content type to be updated.
- Now add an action. We will run a PHP snippet to set the node title, then save the node, so select "Execute custom PHP code".
- In the PHP box, add the following:
<?php
auto_nodetitle_set_title($node);
node_save($node);
?>
- Save the rule!
That should be it. Run a few tests to make sure the rule is working, and enjoy any autonode titles you want! If you really want Node ID's as part of your autonode title, now you have an option!
The disadvantage to this approach is that you need another module (Rules) to make this work. Is it worth it? You decide.