Data Value List Function. This new data value kind allows you to populate a drop down simply by implementing an interface, ISupplyValueAndLabelCollection, that returns a list of items. See here.
US State Supplier. To demonstrate the data value list function, an implementation was added that supplies a list of US states. See here.
The below screenshots show the new data value list function being used with the US state supplier. First, you create a new data value with the "List Function" selected as the type:
Next, you select the function you want to be used to populate the data values:
Once you create a form with a drop down field that has your recently created data value selected, you'll see that the drop down gets rendered with the appropriate values:
This list of US states is built into Formulate, but you can implement your own function that can return whatever you want (e.g., it could query a database for some values, or it could request values from a web service).
Hi Nicholas, Is there a way to add a new Data Value Function from the BackOffice? Just made one for Countries of the world (using your UsStates example) but not sure where to add it?
namespace formulate.app.DataValues.Suppliers.Kinds
{
// Namespaces.
using core.Types;
using System.Collections.Generic;
/// <summary>
/// Supplies a list of Countries.
/// </summary>
public class CountrySupplier : ISupplyValueAndLabelCollection
{
#region Public Properties
/// <summary>
/// The name of this supplier.
/// </summary>
public string Name { get; } = "List of Countries in the world";
#endregion
#region Private Properties
/// <summary>
/// The Countries.
/// </summary>
private List<ValueAndLabel> AllCountries { get; } = new List<ValueAndLabel>()
{
new ValueAndLabel() { Value = "AF", Label = "Afghanistan" },
new ValueAndLabel() { Value = "AL", Label = "Albania" },
new ValueAndLabel() { Value = "DZ", Label = "Algeria" },
new ValueAndLabel() { Value = "AS", Label = "American Samoa" },
new ValueAndLabel() { Value = "AD", Label = "Andorra" },
new ValueAndLabel() { Value = "AO", Label = "Angola" },
new ValueAndLabel() { Value = "AI", Label = "Anguilla" },
new ValueAndLabel() { Value = "AQ", Label = "Antarctica" },
new ValueAndLabel() { Value = "AG", Label = "Antigua And Barbuda" },
new ValueAndLabel() { Value = "AR", Label = "Argentina" },
new ValueAndLabel() { Value = "AM", Label = "Armenia" },
new ValueAndLabel() { Value = "AW", Label = "Aruba" },
new ValueAndLabel() { Value = "AU", Label = "Australia" },
new ValueAndLabel() { Value = "AT", Label = "Austria" },
new ValueAndLabel() { Value = "AZ", Label = "Azerbaijan" },
new ValueAndLabel() { Value = "BS", Label = "Bahamas" },
new ValueAndLabel() { Value = "BH", Label = "Bahrain" },
new ValueAndLabel() { Value = "BD", Label = "Bangladesh" },
new ValueAndLabel() { Value = "BB", Label = "Barbados" },
new ValueAndLabel() { Value = "BY", Label = "Belarus" },
new ValueAndLabel() { Value = "BE", Label = "Belgium" },
new ValueAndLabel() { Value = "BZ", Label = "Belize" },
new ValueAndLabel() { Value = "BJ", Label = "Benin" },
new ValueAndLabel() { Value = "BM", Label = "Bermuda" },
new ValueAndLabel() { Value = "BT", Label = "Bhutan" },
new ValueAndLabel() { Value = "BO", Label = "Bolivia" },
new ValueAndLabel() { Value = "BA", Label = "Bosnia And Herzegovina" },
new ValueAndLabel() { Value = "BW", Label = "Botswana" },
new ValueAndLabel() { Value = "BV", Label = "Bouvet Island" },
new ValueAndLabel() { Value = "BR", Label = "Brazil" },
new ValueAndLabel() { Value = "IO", Label = "British Indian Ocean Territory" },
new ValueAndLabel() { Value = "BN", Label = "Brunei Darussalam" },
new ValueAndLabel() { Value = "BG", Label = "Bulgaria" },
new ValueAndLabel() { Value = "BF", Label = "Burkina Faso" },
new ValueAndLabel() { Value = "BI", Label = "Burundi" },
new ValueAndLabel() { Value = "KH", Label = "Cambodia" },
new ValueAndLabel() { Value = "CM", Label = "Cameroon" },
new ValueAndLabel() { Value = "CA", Label = "Canada" },
new ValueAndLabel() { Value = "CV", Label = "Cape Verde" },
new ValueAndLabel() { Value = "KY", Label = "Cayman Islands" },
new ValueAndLabel() { Value = "CF", Label = "Central African Republic" },
new ValueAndLabel() { Value = "TD", Label = "Chad" },
new ValueAndLabel() { Value = "CL", Label = "Chile" },
new ValueAndLabel() { Value = "CN", Label = "China" },
new ValueAndLabel() { Value = "CX", Label = "Christmas Island" },
new ValueAndLabel() { Value = "CC", Label = "Cocos (Keeling) Islands" },
new ValueAndLabel() { Value = "CO", Label = "Colombia" },
new ValueAndLabel() { Value = "KM", Label = "Comoros" },
new ValueAndLabel() { Value = "CG", Label = "Congo" },
new ValueAndLabel() { Value = "CK", Label = "Cook Islands" },
new ValueAndLabel() { Value = "CR", Label = "Costa Rica" },
new ValueAndLabel() { Value = "CI", Label = "Cote D'Ivoire" },
new ValueAndLabel() { Value = "HR", Label = "Croatia (Local Name: Hrvatska)" },
new ValueAndLabel() { Value = "CU", Label = "Cuba" },
new ValueAndLabel() { Value = "CY", Label = "Cyprus" },
new ValueAndLabel() { Value = "CZ", Label = "Czech Republic" },
new ValueAndLabel() { Value = "DK", Label = "Denmark" },
new ValueAndLabel() { Value = "DJ", Label = "Djibouti" },
new ValueAndLabel() { Value = "DM", Label = "Dominica" },
new ValueAndLabel() { Value = "DO", Label = "Dominican Republic" },
new ValueAndLabel() { Value = "EC", Label = "Ecuador" },
new ValueAndLabel() { Value = "EG", Label = "Egypt" },
new ValueAndLabel() { Value = "SV", Label = "El Salvador" },
new ValueAndLabel() { Value = "GQ", Label = "Equatorial Guinea" },
new ValueAndLabel() { Value = "ER", Label = "Eritrea" },
new ValueAndLabel() { Value = "EE", Label = "Estonia" },
new ValueAndLabel() { Value = "ET", Label = "Ethiopia" },
new ValueAndLabel() { Value = "FK", Label = "Falkland Islands (Malvinas)" },
new ValueAndLabel() { Value = "FO", Label = "Faroe Islands" },
new ValueAndLabel() { Value = "FJ", Label = "Fiji" },
new ValueAndLabel() { Value = "FI", Label = "Finland" },
new ValueAndLabel() { Value = "FR", Label = "France" },
new ValueAndLabel() { Value = "FX", Label = "France, Metropolitan" },
new ValueAndLabel() { Value = "GF", Label = "French Guiana" },
new ValueAndLabel() { Value = "PF", Label = "French Polynesia" },
new ValueAndLabel() { Value = "TF", Label = "French Southern Territories" },
new ValueAndLabel() { Value = "GA", Label = "Gabon" },
new ValueAndLabel() { Value = "GM", Label = "Gambia" },
new ValueAndLabel() { Value = "GE", Label = "Georgia" },
new ValueAndLabel() { Value = "DE", Label = "Germany" },
new ValueAndLabel() { Value = "GH", Label = "Ghana" },
new ValueAndLabel() { Value = "GI", Label = "Gibraltar" },
new ValueAndLabel() { Value = "GR", Label = "Greece" },
new ValueAndLabel() { Value = "GL", Label = "Greenland" },
new ValueAndLabel() { Value = "GD", Label = "Grenada" },
new ValueAndLabel() { Value = "GP", Label = "Guadeloupe" },
new ValueAndLabel() { Value = "GU", Label = "Guam" },
new ValueAndLabel() { Value = "GT", Label = "Guatemala" },
new ValueAndLabel() { Value = "GN", Label = "Guinea" },
new ValueAndLabel() { Value = "GW", Label = "Guinea-Bissau" },
new ValueAndLabel() { Value = "GY", Label = "Guyana" },
new ValueAndLabel() { Value = "HT", Label = "Haiti" },
new ValueAndLabel() { Value = "HM", Label = "Heard Island & Mcdonald Islands" },
new ValueAndLabel() { Value = "HN", Label = "Honduras" },
new ValueAndLabel() { Value = "HK", Label = "Hong Kong" },
new ValueAndLabel() { Value = "HU", Label = "Hungary" },
new ValueAndLabel() { Value = "IS", Label = "Iceland" },
new ValueAndLabel() { Value = "IN", Label = "India" },
new ValueAndLabel() { Value = "ID", Label = "Indonesia" },
new ValueAndLabel() { Value = "IR", Label = "Iran, Islamic Republic Of" },
new ValueAndLabel() { Value = "IQ", Label = "Iraq" },
new ValueAndLabel() { Value = "IE", Label = "Ireland" },
new ValueAndLabel() { Value = "IL", Label = "Israel" },
new ValueAndLabel() { Value = "IT", Label = "Italy" },
new ValueAndLabel() { Value = "JM", Label = "Jamaica" },
new ValueAndLabel() { Value = "JP", Label = "Japan" },
new ValueAndLabel() { Value = "JO", Label = "Jordan" },
new ValueAndLabel() { Value = "KZ", Label = "Kazakhstan" },
new ValueAndLabel() { Value = "KE", Label = "Kenya" },
new ValueAndLabel() { Value = "KI", Label = "Kiribati" },
new ValueAndLabel() { Value = "KP", Label = "Korea, Democratic People'S Republic Of" },
new ValueAndLabel() { Value = "KR", Label = "Korea, Republic Of" },
new ValueAndLabel() { Value = "KW", Label = "Kuwait" },
new ValueAndLabel() { Value = "KG", Label = "Kyrgyzstan" },
new ValueAndLabel() { Value = "LA", Label = "Lao People'S Democratic Republic" },
new ValueAndLabel() { Value = "LV", Label = "Latvia" },
new ValueAndLabel() { Value = "LB", Label = "Lebanon" },
new ValueAndLabel() { Value = "LS", Label = "Lesotho" },
new ValueAndLabel() { Value = "LR", Label = "Liberia" },
new ValueAndLabel() { Value = "LY", Label = "Libyan Arab Jamahiriya" },
new ValueAndLabel() { Value = "LI", Label = "Liechtenstein" },
new ValueAndLabel() { Value = "LT", Label = "Lithuania" },
new ValueAndLabel() { Value = "LU", Label = "Luxembourg" },
new ValueAndLabel() { Value = "MO", Label = "Macau" },
new ValueAndLabel() { Value = "MK", Label = "Macedonia, The Former Yugoslav Republic Of" },
new ValueAndLabel() { Value = "MG", Label = "Madagascar" },
new ValueAndLabel() { Value = "MW", Label = "Malawi" },
new ValueAndLabel() { Value = "MY", Label = "Malaysia" },
new ValueAndLabel() { Value = "MV", Label = "Maldives" },
new ValueAndLabel() { Value = "ML", Label = "Mali" },
new ValueAndLabel() { Value = "MT", Label = "Malta" },
new ValueAndLabel() { Value = "MH", Label = "Marshall Islands" },
new ValueAndLabel() { Value = "MQ", Label = "Martinique" },
new ValueAndLabel() { Value = "MR", Label = "Mauritania" },
new ValueAndLabel() { Value = "MU", Label = "Mauritius" },
new ValueAndLabel() { Value = "YT", Label = "Mayotte" },
new ValueAndLabel() { Value = "MX", Label = "Mexico" },
new ValueAndLabel() { Value = "FM", Label = "Micronesia, Federated States Of" },
new ValueAndLabel() { Value = "MD", Label = "Moldova, Republic Of" },
new ValueAndLabel() { Value = "MC", Label = "Monaco" },
new ValueAndLabel() { Value = "MN", Label = "Mongolia" },
new ValueAndLabel() { Value = "MS", Label = "Montserrat" },
new ValueAndLabel() { Value = "MA", Label = "Morocco" },
new ValueAndLabel() { Value = "MZ", Label = "Mozambique" },
new ValueAndLabel() { Value = "MM", Label = "Myanmar" },
new ValueAndLabel() { Value = "NA", Label = "Namibia" },
new ValueAndLabel() { Value = "NR", Label = "Nauru" },
new ValueAndLabel() { Value = "NP", Label = "Nepal" },
new ValueAndLabel() { Value = "NL", Label = "Netherlands" },
new ValueAndLabel() { Value = "AN", Label = "Netherlands Antilles" },
new ValueAndLabel() { Value = "NC", Label = "New Caledonia" },
new ValueAndLabel() { Value = "NZ", Label = "New Zealand" },
new ValueAndLabel() { Value = "NI", Label = "Nicaragua" },
new ValueAndLabel() { Value = "NE", Label = "Niger" },
new ValueAndLabel() { Value = "NG", Label = "Nigeria" },
new ValueAndLabel() { Value = "NU", Label = "Niue" },
new ValueAndLabel() { Value = "NF", Label = "Norfolk Island" },
new ValueAndLabel() { Value = "MP", Label = "Northern Mariana Islands" },
new ValueAndLabel() { Value = "NO", Label = "Norway" },
new ValueAndLabel() { Value = "OM", Label = "Oman" },
new ValueAndLabel() { Value = "PK", Label = "Pakistan" },
new ValueAndLabel() { Value = "PW", Label = "Palau" },
new ValueAndLabel() { Value = "PA", Label = "Panama" },
new ValueAndLabel() { Value = "PG", Label = "Papua New Guinea" },
new ValueAndLabel() { Value = "PY", Label = "Paraguay" },
new ValueAndLabel() { Value = "PE", Label = "Peru" },
new ValueAndLabel() { Value = "PH", Label = "Philippines" },
new ValueAndLabel() { Value = "PN", Label = "Pitcairn" },
new ValueAndLabel() { Value = "PL", Label = "Poland" },
new ValueAndLabel() { Value = "PT", Label = "Portugal" },
new ValueAndLabel() { Value = "PR", Label = "Puerto Rico" },
new ValueAndLabel() { Value = "QA", Label = "Qatar" },
new ValueAndLabel() { Value = "RE", Label = "Reunion" },
new ValueAndLabel() { Value = "RO", Label = "Romania" },
new ValueAndLabel() { Value = "RU", Label = "Russian Federation" },
new ValueAndLabel() { Value = "RW", Label = "Rwanda" },
new ValueAndLabel() { Value = "SH", Label = "Saint Helena" },
new ValueAndLabel() { Value = "KN", Label = "Saint Kitts And Nevis" },
new ValueAndLabel() { Value = "LC", Label = "Saint Lucia" },
new ValueAndLabel() { Value = "PM", Label = "Saint Pierre And Miquelon" },
new ValueAndLabel() { Value = "VC", Label = "Saint Vincent And The Grenadines" },
new ValueAndLabel() { Value = "WS", Label = "Samoa" },
new ValueAndLabel() { Value = "SM", Label = "San Marino" },
new ValueAndLabel() { Value = "ST", Label = "Sao Tome And Principe" },
new ValueAndLabel() { Value = "SA", Label = "Saudi Arabia" },
new ValueAndLabel() { Value = "SN", Label = "Senegal" },
new ValueAndLabel() { Value = "SC", Label = "Seychelles" },
new ValueAndLabel() { Value = "SL", Label = "Sierra Leone" },
new ValueAndLabel() { Value = "SG", Label = "Singapore" },
new ValueAndLabel() { Value = "SK", Label = "Slovakia (Slovak Republic)" },
new ValueAndLabel() { Value = "SI", Label = "Slovenia" },
new ValueAndLabel() { Value = "SB", Label = "Solomon Islands" },
new ValueAndLabel() { Value = "SO", Label = "Somalia" },
new ValueAndLabel() { Value = "ZA", Label = "South Africa" },
new ValueAndLabel() { Value = "ES", Label = "Spain" },
new ValueAndLabel() { Value = "LK", Label = "Sri Lanka" },
new ValueAndLabel() { Value = "SD", Label = "Sudan" },
new ValueAndLabel() { Value = "SR", Label = "Suriname" },
new ValueAndLabel() { Value = "SJ", Label = "Svalbard And Jan Mayen Islands" },
new ValueAndLabel() { Value = "SZ", Label = "Swaziland" },
new ValueAndLabel() { Value = "SE", Label = "Sweden" },
new ValueAndLabel() { Value = "CH", Label = "Switzerland" },
new ValueAndLabel() { Value = "SY", Label = "Syrian Arab Republic" },
new ValueAndLabel() { Value = "TW", Label = "Taiwan, Province Of China" },
new ValueAndLabel() { Value = "TJ", Label = "Tajikistan" },
new ValueAndLabel() { Value = "TZ", Label = "Tanzania, United Republic Of" },
new ValueAndLabel() { Value = "TH", Label = "Thailand" },
new ValueAndLabel() { Value = "TG", Label = "Togo" },
new ValueAndLabel() { Value = "TK", Label = "Tokelau" },
new ValueAndLabel() { Value = "TO", Label = "Tonga" },
new ValueAndLabel() { Value = "TT", Label = "Trinidad And Tobago" },
new ValueAndLabel() { Value = "TN", Label = "Tunisia" },
new ValueAndLabel() { Value = "TR", Label = "Turkey" },
new ValueAndLabel() { Value = "TM", Label = "Turkmenistan" },
new ValueAndLabel() { Value = "TC", Label = "Turks And Caicos Islands" },
new ValueAndLabel() { Value = "TV", Label = "Tuvalu" },
new ValueAndLabel() { Value = "UG", Label = "Uganda" },
new ValueAndLabel() { Value = "UA", Label = "Ukraine" },
new ValueAndLabel() { Value = "AE", Label = "United Arab Emirates" },
new ValueAndLabel() { Value = "GB", Label = "United Kingdom" },
new ValueAndLabel() { Value = "US", Label = "United States" },
new ValueAndLabel() { Value = "UM", Label = "United States Minor Outlying Islands" },
new ValueAndLabel() { Value = "UY", Label = "Uruguay" },
new ValueAndLabel() { Value = "UZ", Label = "Uzbekistan" },
new ValueAndLabel() { Value = "VU", Label = "Vanuatu" },
new ValueAndLabel() { Value = "VA", Label = "Vatican City State (Holy See)" },
new ValueAndLabel() { Value = "VE", Label = "Venezuela" },
new ValueAndLabel() { Value = "VN", Label = "Viet Nam" },
new ValueAndLabel() { Value = "VG", Label = "Virgin Islands (British)" },
new ValueAndLabel() { Value = "VI", Label = "Virgin Islands (U.S.)" },
new ValueAndLabel() { Value = "WF", Label = "Wallis And Futuna Islands" },
new ValueAndLabel() { Value = "EH", Label = "Western Sahara" },
new ValueAndLabel() { Value = "YE", Label = "Yemen" },
new ValueAndLabel() { Value = "YU", Label = "Yugoslavia" },
new ValueAndLabel() { Value = "ZR", Label = "Zaire" },
new ValueAndLabel() { Value = "ZM", Label = "Zambia" },
new ValueAndLabel() { Value = "ZW", Label = "Zimbabwe" },
};
#endregion
#region Methods
/// <summary>
/// Returns the Countries.
/// </summary>
/// <returns>
/// The Countries.
/// </returns>
public IEnumerable<ValueAndLabel> GetValues()
{
return AllCountries;
}
#endregion
}
}
Now that you've implemented that interface, you can simply right click the Data Values node in the Formulate section, create a new data value that has a type of List Function, then select your function in the drop down (it should appear as List of Countries in the world).
Hi Nicholas, (backing it up a little here, due to my extreme lack of back-end knowledge) I have made the .cs file on my local system, but am unsure how to get it (or where to put it) into my Umbraco install. Eg. do i ftp it to a particular folder or paste the script in the backoffice system somewhere?
Pretty much the same way you would for any other C# ASP.NET MVC project.
Probably the best way would be to add that CS file to a class library, then reference that class library from you web application project to ensure the class library's DLL gets included in the website's bin folder.
Another way that may or may not work would be to include the CS file in the App_Code folder. That has a number of downsides though, so it's not really recommended.
Deployment is a separate question. If you normally deploy with FTP, that's how you'd deploy this change (either the class library DLL in the bin folder, or the CS file in the App_Code folder).
Ok, thanks Nicholas, I am not a coder (as you may have guessed) I am just working with a web install of umbraco, not through an MVC Project. I have placed the .cs file in the App_Code folder but there must be more to it since the function does not appear in the Data Value list.
From your reply it seems as though this function has been added more for an mvc-developer than a front-end. It would be great if there was a way to add a list of data values in a more user friendly manner.
it would be great if there was a way to add a list of data values in a more user friendly manner.
There is. You can right click "Data Values", select "Pair List", then type each value.
You'd only want to implement ISupplyValueAndLabelCollection when you have some need to create the data programmatically (e.g., when you need to fetch the data from a database or a web API).
Lol, :-) Excellent for smaller selections but manually typing the country list doesn't sound user-friendly to me, however thank you for your responses, at this stage I'll just leave it as a text field.
You've actually done well considering you're not familiar with the backend technology. If you're looking to save a few keystrokes, note that data values are stored as text files (in a JSON format) in the folder ~/App_Data/Formulate/Json/DataValues/. You could edit that file rather than typing the values into the back office. If you have them in Excel or something, you could probably create some calculations to automatically construct the appropriate string that you can then paste into the file.
Formulate 0.3.6 Just Released (Data Value List Functions)
You can download it here: https://our.umbraco.org/projects/backoffice-extensions/formulate/
Here are the main changes that were made:
ISupplyValueAndLabelCollection
, that returns a list of items. See here.The below screenshots show the new data value list function being used with the US state supplier. First, you create a new data value with the "List Function" selected as the type:
Next, you select the function you want to be used to populate the data values:
Once you create a form with a drop down field that has your recently created data value selected, you'll see that the drop down gets rendered with the appropriate values:
This list of US states is built into Formulate, but you can implement your own function that can return whatever you want (e.g., it could query a database for some values, or it could request values from a web service).
Further release notes can be found here: https://github.com/rhythmagency/formulate/releases/tag/v0.3.6
If you've never heard of Formulate, you can read about it here: http://www.formulate.rocks/
Oops, skipped a step when updating the package. Should be ready to download now: https://our.umbraco.org/projects/backoffice-extensions/formulate/
Hi Nicholas, Is there a way to add a new Data Value Function from the BackOffice? Just made one for Countries of the world (using your UsStates example) but not sure where to add it?
Now that you've implemented that interface, you can simply right click the
Data Values
node in the Formulate section, create a new data value that has a type ofList Function
, then select your function in the drop down (it should appear asList of Countries in the world
).BTW, there is no reason to use this namespace:
namespace formulate.app.DataValues.Suppliers.Kinds
You can use your own namespace. That's just the one Formulate happens to use for the core functionality.
Hi Nicholas, (backing it up a little here, due to my extreme lack of back-end knowledge) I have made the .cs file on my local system, but am unsure how to get it (or where to put it) into my Umbraco install. Eg. do i ftp it to a particular folder or paste the script in the backoffice system somewhere?
Pretty much the same way you would for any other C# ASP.NET MVC project.
Probably the best way would be to add that CS file to a class library, then reference that class library from you web application project to ensure the class library's DLL gets included in the website's
bin
folder.Another way that may or may not work would be to include the CS file in the
App_Code
folder. That has a number of downsides though, so it's not really recommended.Deployment is a separate question. If you normally deploy with FTP, that's how you'd deploy this change (either the class library DLL in the
bin
folder, or the CS file in theApp_Code
folder).Ok, thanks Nicholas, I am not a coder (as you may have guessed) I am just working with a web install of umbraco, not through an MVC Project. I have placed the .cs file in the App_Code folder but there must be more to it since the function does not appear in the Data Value list.
From your reply it seems as though this function has been added more for an mvc-developer than a front-end. It would be great if there was a way to add a list of data values in a more user friendly manner.
There is. You can right click "Data Values", select "Pair List", then type each value.
You'd only want to implement
ISupplyValueAndLabelCollection
when you have some need to create the data programmatically (e.g., when you need to fetch the data from a database or a web API).Lol, :-) Excellent for smaller selections but manually typing the country list doesn't sound user-friendly to me, however thank you for your responses, at this stage I'll just leave it as a text field.
You've actually done well considering you're not familiar with the backend technology. If you're looking to save a few keystrokes, note that data values are stored as text files (in a JSON format) in the folder
~/App_Data/Formulate/Json/DataValues/
. You could edit that file rather than typing the values into the back office. If you have them in Excel or something, you could probably create some calculations to automatically construct the appropriate string that you can then paste into the file.If you'd like a feature for something like a bulk import, please submit a feature request here: https://github.com/rhythmagency/formulate/issues
It's also open source, so if you know of any ready and willing developers, I would welcome a pull request.
Awesome that's the easy option I was looking for, a bit of find and replace and the Country list is sorted. Thank you!
is working on a reply...