US States list for CCK select boxes

4.333335
Average: 4.3 (3 votes)

When defining Content Types in Drupal with the Content Construction Kit you are able to add select boxes to them with CCK. It takes its
key/value pairs in this format: Key|Value. One of the most common tasks for this is to create a drop down list of US States. So to save folks some time, I have compiled a list for you to paste right into your own projects. The attached text file will give you US States in the expected format.

Hopefully this will save others a bit of typing when you need such a list for your own Drupal projects. Enjoy!

Trackback URL for this post:

http://drupaleasy.com/trackback/9
from xentek on Fri, 08/22/2008 - 16:09

When defining Content Types in Drupal with the Content Construction Kit you get a chance to make select dropdowns with it. It takes its key/value pairs in this format: Key|Value. The attached list will give you US States in this format. Hopefully this ...

Comments

Pingback

[...] Go to the author’s original blog: US States list for CCK select boxes [...]

This is a convenient list,

4

This is a convenient list, thanks! I hope that others will find it before building it themselves. In all the time and all the CCK forms I've built, I don't think I've actually built a list of states in the US.

I've shared a different kind list but for the same reason. It's a list of domains (for Drupal's 'access' table) to help prevent user accounts from using throwaway email addresses from services like Mailinator and Spam Gourmet.

I'm glad you found it

I'm glad you found it useful. I was surprised not to see one out there, and after a little command line magic to format the list into the CCK style, I figured I'd post it out there to save some others the time.

And thanks for linking to your list, I've bookmarked it for future reference.

- Eric Marden

Post new comment

The content of this field is kept private and will not be shown publicly.
 
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Syndicate content