This project is not covered by Drupal’s security advisory policy.

The Domain Country API module provides storage and retrieval mechanisms that allow countries to be mapped to domains. It integrates with the Domain Access module so that domains that are currently defined will be made available to a list of countries, in order to assign that country to that domain.

The typical use case is an international site that uses various subdomains to provide localized content to users around the world. While many countries may have appropriate subdomains, many countries will not have localized content, and should therefore belong to the default domain, which would be the worldwide domain.

After enabling the module, a map of countries needs to be set up. A file, "country_regions.csv" is provided that contains a default implementation. Edit this file to suit your needs, then upload it at the Country Map Import page. Each country defined has 5 attributes: 2 letter country code, full country name, region name (this is analogous to the associated domain's "sitename" property, but can differ from it if necessary), domain id, and whether the country is "enabled" or not.

The backend is a database table, and a set of functions that can be implemented to save and retrieve this mapping, as well as a user interface that allows you to enable or disable each country, and assign it to any of the enabled domains. Also, while configuring a domain, there are now form elements to give each domain a "Region Name" and its "Default Country" (which is necessary as sub-domains are now assumed to only be used for localizing content).

Project information

  • By jessehs on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases