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

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

I found this UK Counties list that looks half decent (checked with Hanabi’s comments):

http://p2p.wrox.com/asp-forms/2592-list-uk-countys.html#post76885

With nice break-down of areas (South East, Scotland, Wales, etc).

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

Thanks for the link Peter. I just used various sources to try and make the UK county list more complete, and updated both the plugin and FF fieldtype. Both available on GitHub now.

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

Thanks man. I’m still trying to get a better list for you myself. North Humberside and South Humberside are not needed as they no longer exist. North Humberside was replaced by East Yorkshire but it is known as East Riding of Yorkshire. South Humberside was replaced by North Lincolnshire and North East Lincolnshire. :

I guess the naming of counties is more complex over here. Lol.

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

Brilliant, thanks Derek - and many thanks again for the essential plugin.

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

I guess i’m more familiar with the county names local to me as I know the politics and uproar that went on with the endless renaming of the counties.

Annoying when i’m trying to order things online and they always check my postcode and say that I am in South Humberside, which hasn’t existed for about 10 years or so. This is mainly because of the UK Postal service and the amount of systems that allegedly have to change to update county names.

       
tektraveler's avatar
tektraveler
10 posts
15 years ago
tektraveler's avatar tektraveler

Thanks for this! Perfect for a project I am on right now.

My client just found a typo in a state name :D

“Distric of Columbia”

"DC" => "Distric of Columbia"

I corrected my local copy to:

"DC" => "District of Columbia"

The typo appears in both the FF and plugin versions.

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

Oops. Thanks for catching that!

       
grantmx's avatar
grantmx
1,439 posts
15 years ago
grantmx's avatar grantmx

D - can you add a tabindex parameter for accessibility?

       
Brian M.'s avatar
Brian M.
529 posts
15 years ago
Brian M.'s avatar Brian M.

Any way to have US states listed before Canadian provinces other than selecting them manually in a parameterd? Ideally it would be cool to separate the two with something in the drop-down list?

EDIT: Parameterd - I’ll have to write that one down!

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

Marshall – good idea, I’ll add the tabindex parameter.

Brian – not right now, but I’ll look into that.

       
grantmx's avatar
grantmx
1,439 posts
15 years ago
grantmx's avatar grantmx

:coolsmirk: “Excellent”, muttered slowly in a low, sinister voice while tenting fingertips…

       
Peter Lewis's avatar
Peter Lewis
280 posts
15 years ago
Peter Lewis's avatar Peter Lewis
Any way to have US states listed before Canadian provinces other than selecting them manually in a parameterd? Ideally it would be cool to separate the two with something in the drop-down list? EDIT: Parameterd - I’ll have to write that one down!

You could modify line 110 of the FieldFrame version, so instead of:

array_merge($this->provinces, $this->states)

it says:

array_merge($this->states, $this->provinces)

Or create a new parameterd that was “states_provinces” and replace the line above with:

if ($field_settings['type'] == 'provinces_states' )
    $list = array_merge($this->provinces, $this->states)
else if ($field_settings['type'] == 'states_provinces' )
    $list = array_merge($this->states, $this->provinces);
else
    $this->$field_settings['type'];

You’ll also need to add it to the types array:

var $types = array(
        'countries' => 'Countries',
        'states' => 'U.S. States',
        'provinces' => 'Canadian Provinces',
        'provinces_states' => 'Canadian Provinces & U.S. States',
        'states_provinces' => 'U.S. States & Canadian Provinces',
        'ukcounties' => 'UK Counties'
    );

To add dividers, simply (!) modify the appropriate variable:

var $provinces = array("" => "Canadian Provinces", "AB" => "Alberta", "BC" => "British Columbia"...

Although that’s a massive fudge and not the best way to do it!

       
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.