If you are not a developer (or want to speed up the development process), another possible solution is to use the auto_nodetitle module. Auto nodetitle allows you to create rules for creating a node name. It can be program rules, tokens that are replaced, or just static text. Worth a look, if nothing else.
And add to William OConnor solution ...
Unfortunately, the module is poorly documented. It is really effective if you use PHP with it, in my opinion. Check "Rate PHP in template" and enter in the "Template for title" field something like:
<?php echo $node->field_staff_email[0]['email']; ?>
or
<?php echo $node->field_staff_name[0]['value'] . '-' . gmdate('YmdHis'); ?>
... where I have a field with the internal name "field_staff_email" and the CCK email module is used, so the type "email" was used. Or I had a field with the internal name "field_staff_name" and was just a plain text field - so the value type was used. The call to gmdate () at the end is to ensure uniqueness, because you can have two or more employees named the same.
As I discovered all this, first experimented with:
<?php print_r($node); ?>
... which, of course, gave crazy results, but at least I managed to analyze the output and figure out how to use the $ node object correctly.
Just note that if you use any of these PHP routines, you will get a list of contents in Drupal Admin showing the entries exactly the same as you encoded PHP. This is why I did not just use gmdate (), because then it would be difficult to find my entry for editing.
Note that you can use Base-36 to gmdate () conversion to reduce output size because gmdate ('YmdHis') is quite long.
Volomike
source share