Experimental project
This is a sandbox project, which contains experimental code for developer use only.
This module provides the possibility to add a field with a list of countries, something which is very usual when building a site with registered users. In front of other existent modules, this offers extrem simplicity on its configuration since it is based on the core list of countries, which means that you instantly get the list of all the countries with their translation on you own language (if you are using the translation provided for Drupal core on your language which is likely to have all the countries properly translated to your language). Having the list of countries "as a list" is far better than using a simple text field, because it avoids spelling errors on user input.
The advantage of that module is that it is simple, uses a resource existing on every installed Drupal site and it is multilingual. Other modules fail on that list. Location or Address Field are very complete addresses solutions that provide the country list and its translation, but among many other fields that you will not require if you are only interested that your users introduce their country. Countries is a very powerful module to manage a list of countries despite it fails on its multilingual approach, which obligues to introduce the translation name to every country through regular locale translation, when countries are already translated on the core list, which is not used. All these modules may be interesting for many other reason, but they are very heaveweight for just having a countries list field on you entities.
Using it is very easy: activate the module as any other module, and add a field of type "Countries" on your entity (node, user, comment,order,...), that's all. And enjoy! The output formatter provides 3 possibilities: the translated name on the current language, the country code and the country code on lowercase. It has been tested with Views, Field Formatter Conditions and Rules.
You can find a complete explanation on how a field module is built using that one as an example in our Blog (on spanish).
| Attachment | Size |
|---|---|
| Country List Module v.1.0.3 Zip File.zip.zip | 3.36 KB |
Project information
- Project categories: Site structure
- Created by jorditr on , updated
