I have created a custom content type called employees. Each employee has a unique employee id that we assign to them. I would like to force this employee id field to be unique for this content type. The employee id could be the node title, or a CCK text field. I thought about adding a unique mysql index to the content_type_employees table, however this is not possible because the table also includes revisions, so the same employee id can be there more than once. I was hoping a module existed for something like unique node title by content type, or unique CCK field.

Anyone know of a way to do this? Maybe I will have to create a custom implementation of hook_nodeapi?

Thanks

Comments

panis’s picture

arithmetric’s picture

Hi drenton,

You might want to give my module, unique field, a try: http://drupal.org/project/unique_field

It allows you to require that nodes have a unique title or CCK field value among nodes of the same content type or all nodes.

Is this the functionality you're looking for?