Ensuring a CCK field has unique values
27th Jan 2009
Steven Jones
Senior Developer
Hey, you seem to look at this article a lot! Why not Bookmark this article so you can find it easily in the future?
Super quick one this: say you have a CCK field on a particular node whose values you want to ensure are unique across all nodes on your site, you could write yourself a nice little helper module, or some PHP directly into the CCK field validation section of the admin form, but, a helper module already exists!
Unique field is a lovely little module that allows you to say that a particular text, number or date field should have unique values across the site, or indeed in that node.
I used this on a user's profile node for a 'alias' field, thus ensuring that everyone chose unique aliases!