Training

Our next U.S. stop:

Mike Anello and Andrew Riley from Mediacurrent are teaming up to offer the first Blue Collar Git workshop on Friday, June 8 as part of DrupalCamp Charlotte (also part of the Southeast LinuxFest). The cost is only $149 for the full day if you register during the month of May ($199 otherwise). 

New Podcast

Posted Wednesday, May 9 at 7:50 am
Brandon Morrison (Brandonian on drupal.org) joins Andrew Riley and Mike Anello on the first post-DrupalCon Denver edition of the podcast to talk about all things Geo in Drupal 7. Brandon is one of the maintainers of the GeoField module and is an active member of the Drupal Geo community.
Download Podcast 82
DrupalEasy_ep82_20120509.mp3
Syndicate content

Newsletter

Stay up-to-date on DrupalEasy workshops and other events. On average, we send about one newsletter per month.

Testimonial

Mike is a great teacher!

Who are we?

DrupalEasy is the collective expertise of Ryan Price and Michael Anello, who joined forces to provide training and consulting services worldwide. Read all about them and what they can do.

What is Drupal?

Drupal is a free, super-powerful content management system for sites that require information posting and collection, including blogs, forums, videos, photos, and databases of information. We think it is the best platform available. Here's why...

Why Drupal?

More and more savvy organizations are going with Drupal for content management, and its no mystery why. It’s free, flexible, and easy to maintain for small or large volume sites. Learn more...

US States list for CCK select boxes

Average: 3.9 (14 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

US States - Drop Down menu in Drupal

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 ...

AttachmentSize
states.txt646 bytes

9 comments

ryanprice wrote 16 weeks 4 days ago

Looks like the original

Looks like the original author of this post has taken down the file.

Here is a source for the list I found:
http://www.kendallsdesign.com/list-us-states-keylabel-style-format

venkat wrote 16 weeks 4 days ago

I am getting forbidden 403

I am getting forbidden 403 page.

Please give the permission to download that file.

kirsten brooks wrote 1 year 44 weeks ago

This is great! I was looking

5

This is great! I was looking for a dropdown list of states and was starting to think that I'd have to hand-type them all out - thanks for providing this - what a time saver!

ericmarden wrote 3 years 11 weeks ago

Hi 'Guest' When creating a

Hi 'Guest'

When creating a new field, you have the option of making it a select list. The text file is in the format that this field requires. Just paste it in and it will be populated correctly.

- Eric Marden

- Eric Marden

Guest wrote 3 years 11 weeks ago

This is just what I was

This is just what I was looking for but how does one get this into CCK and out again as a dropdown?

ryanprice wrote 3 years 13 weeks ago

This just saved my butt again

This just saved my butt again - not for CCK, but just because I remembered there was a list matching state shortcodes to state names.

The only one I got wrong was Nebraska (NE), other than that, I am 98% state-competent.

ericmarden wrote 3 years 37 weeks ago

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

- Eric Marden

christefano wrote 3 years 38 weeks ago

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.

US States list for CCK select boxes wrote 3 years 38 weeks ago

Pingback

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

Add your 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> <blockquote>
  • Lines and paragraphs break automatically.

More information about formatting options

Syndicate content