We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New plugin: REEgion Select

Development and Programming

Derek Hogue's avatar
Derek Hogue
316 posts
16 years ago
Derek Hogue's avatar Derek Hogue

Hey all - another plugin spawned by a site I’m working on. I needed a dropdown list of countries and a combined dropdown of US states and Canadian provinces in a couple of spots on the site. Rather than using two or more plugins to do this, I decided to spend some extra time and try my hand at the one regional dropdown plugin to rule them all. 😊

REEgion Select will display a dropdown <select> list of:

  • countries (based on the ISO 3166-1 list of countries, dependent territories, and special areas of geographical interest)
  • US states (based on the USPS official list of US states and possessions)
  • Canadian provinces and territories
  • UK counties
  • Canadian provinces and US states together

Download from GitHub

See also the FieldFrame version for use in the EE control panel.

Insipiration from - and props to - Nathan Pitman’s UK Counties Select (where I got the list of counties from) and US States Select plugins, and Bridging Unit’s Countries Select plugin.

       
Nathan Pitman's avatar
Nathan Pitman
531 posts
16 years ago
Nathan Pitman's avatar Nathan Pitman

Hi D-Rock, excellent work. Would also be worth porting to Field Frame! 😊

       
Derek Hogue's avatar
Derek Hogue
316 posts
16 years ago
Derek Hogue's avatar Derek Hogue

Not a bad idea Nathan, I should give that a shot.

       
BridgingUnit's avatar
BridgingUnit
214 posts
16 years ago
BridgingUnit's avatar BridgingUnit

Hey D-rock - nice work. Converting to FieldFrame should be pretty easy - it’s quite straightforward. One thing though for this - it’d be a good idea to namespace your plugin using a unique prefix in case it clashes with some other one now or in the future.

       
Derek Hogue's avatar
Derek Hogue
316 posts
16 years ago
Derek Hogue's avatar Derek Hogue

Just thought I’d let everyone know that I finally got REEgion Select ported to FieldFrame, for those of you looking to use it via the back-end rather than on the front-end.

http://github.com/amphibian/reegion_select.ff_fieldtype/

       
Chris Arnold's avatar
Chris Arnold
201 posts
15 years ago
Chris Arnold's avatar Chris Arnold

Thanks for the solid start on the lists, D-Rock. I’m currently developing a site where I’ll need the client to select a state or country within an entry post, that will then be searchable through the same parameter (the 2 digit code) on the front end.

I just installed the FF back end version, but whenever an entry is saved, it defaults to the last list item. Do you know what this may be from? Any thoughts?

       
Chris Arnold's avatar
Chris Arnold
201 posts
15 years ago
Chris Arnold's avatar Chris Arnold

I also just noticed if I include the pre-populated list for the front end while having the FF back end fieldtype list setup for a custom field, it throws the following error:

Fatal error: Call to undefined method Reegion_select::usage() in .../plugins/pi.reegion_select.php on line 9

Is one not meant to be used with the other? This is my first time working with these files, so I could very well be approaching it incorrectly. My thought process is if I were to select “Texas” for the entry’s state and publish it, I should just as well be able to search for Texas on the front end and have that entry display in a results page; in other words both plugin and fieldtype working together.

Can you point me in the right direction?

       
Derek Hogue's avatar
Derek Hogue
316 posts
15 years ago
Derek Hogue's avatar Derek Hogue

Thanks for catching those bugs, I appreciate it. I’ve just pushed version 1.0.1 to GitHub, which should fix both of these issues.

I had to rename the class to Reegion_select_ff to avoid the conflict with my REEgion Select plugin, which means the name of the fieldtype folder has changed as well. You’ll want to first remove the version 1.0 fieldtype, then upload the 1.0.1 version. You may have to revisit your custom field setting as well to choose REEgion Select again (but don’t worry - your existing entry data will remain unchanged.)

Let me know if the update sorts this out for you?

       
Peter Lewis's avatar
Peter Lewis
280 posts
15 years ago
Peter Lewis's avatar Peter Lewis

Hi D-Rock,

Great plugin, perfect for my ecommerce sites where I have to use ISO countries to pass to the payment gateways - many thanks.

Some additions needed for the UK Counties list: “West Midlands” - had a client complain as one of their customers from that county tried to purchase and couldn’t enter their address! “Sussex” isn’t actually a county, it’s two: “East Sussex” and “West Sussex” Like East and West Lothian.

Have added these in manually, but thought I should give you a heads up.

Another change request: I’ve got 2 ecommerce payment gateways that require a 3 digit country code based on ISO, so any chance the plugin could be modified to allow a choice in the back-end of which ISO standard is used for the list? I can provide a ready to use list of countries and 3 digits if it helps?

Thanks,

Peter

       
Derek Hogue's avatar
Derek Hogue
316 posts
15 years ago
Derek Hogue's avatar Derek Hogue

Thanks Peter, I’ll fix up those counties.

Re: adding ISO Alpha-3 - I’ll think on that. It’s a bit of an edge case, as it only applies to the country list and not the others.

       
doubleplusgood's avatar
doubleplusgood
199 posts
15 years ago
doubleplusgood's avatar doubleplusgood

Hey D-Rock,

Could you please add North Lincolnshire and North East Lincolnshire to the UK Counties? Lincolnshire should still remain. :D

Thank you, Neil

       
Derek Hogue's avatar
Derek Hogue
316 posts
15 years ago
Derek Hogue's avatar Derek Hogue
Could you please add North Lincolnshire and North East Lincolnshire to the UK Counties?

I don’t see these on the Wikipedia listing, nor the Association of British Counties list.

Looks like it’s a Borough, not a County?

       
doubleplusgood's avatar
doubleplusgood
199 posts
15 years ago
doubleplusgood's avatar doubleplusgood

I think that list is out of date, as it still lists Humberside and South Humberside which have not existed for a number of years. 😊 Probably based from the Postal Service list which still hasn’t updated to North Lincolnshire and North East Lincolnshire.

       
Derek Hogue's avatar
Derek Hogue
316 posts
15 years ago
Derek Hogue's avatar Derek Hogue

Any chance you could find me an authoritative list (being a Brit yourself)? Being from Canada, I haven’t the foggiest idea what to look for as red flags indicating the currency of any particular list.

       
doubleplusgood's avatar
doubleplusgood
199 posts
15 years ago
doubleplusgood's avatar doubleplusgood

Sure. Some other changes would be to split up Yorkshire into; North Yorkshire, South Yorkshire, East Yorkshire and West Yorkshire. :D

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.