About Continents And Countries
Displays countries and continents.
|Category 1||Field Types|
Fieldtype modules that represent a data type used by fields.
|Category 2||Language Modules|
Modules involved in providing multi-language support.
|Category 3||Markup Generation|
Markup modules that are called upon to generate or parse markup (like HTML). Markup modules are most often used on the front-end of a site (rather than admin).
Should be safe for use in production environments. *
|Date Added||September 28, 2015|
|Last Updated||May 30, 2017|
This module's files should be placed in /site/modules/ContinentsAndCountries/
How to install or uninstall modules
This repository will not be updated. The repository will be kept available in read-only mode.
Displays countries and continents and their iso codes.
The "value" for each country is the two-letter country code.
As an added bonus, the country names are displayed in the language of the user (sorted by name ASC) if the appropriate translation was added.
This module adds a Fieldtype: Select Options Countries.
<?php $countries = $modules->get('ContinentsAndCountries')->findByContinent('eu'); ?> <select> <?php foreach ($countries as $country): ?> <option value="<?=$country->code; ?>"> <?=$country->name; ?> </option> <?php endforeach; ?> </select>
To translate the continents and countries, you must have the ProcessWire Language Support module installed. This is included with ProcessWire, so all you have to do is click to Modules > Language > Language Support > install.
Once you have Language Support installed, you have to add or edit the desired language by going to Setup > Languages > Add New Language. Enter a title and name for the language and save.
Next, you can add the file for the language (have a look at site/modules/ContinentsAndCountries/translations/ if the translation for your language exists) or translate it manually.
- $continent has to be one of af, as, eu, na, sa, oc, an
- (Africa, Asia, Europe, North America, South America, Oceania, Antarctica)
- findBy($table = 'countries', $select = array(), $options = array())
findBy('countries', array('name', 'iso'), array(id => 2))
array (size=1) 0 => object(stdClass) public 'name' => string 'Åland-Inseln' (length=13) public 'iso' => string 'ALA' (length=3)
- Admin Helpers
- Core Modules
- Development Tools
- Field Types
- Input Fields
- Language Modules
- Language Packs
- Markup Generation
- Premium Modules
- Process Modules
- Proof of Concept
- Site Profiles
- Social, Feeds, Services
- Text Formatters
- Other Modules
- Users and Access
*Use modules at your own risk. There are no guarantees or warranties. It is recommended that you backup your site and database before installing new modules.