How to map the country field with external database authentication?

Re: How to map the country field with external database authentication?

by Marcus Green -
Number of replies: 1
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Core Moodle includes a user field that allows the selection from a list of ISO 3166 country names to be stored and displayed in the dropdown selection box on a user profile page. These values can be seen here.


The country name you are using may not always exactly map to the ISO name, e.g. the official name of what I think of as “The Czech Republic” is stored as the ISO country name of Czechia. These values are stored in a file called
lang\en\countries.php
in the form
$string['GB'] = 'United Kingdom';

So as you say it is not a free form field, but a key/pair mapping. It will also depend on what country name you are using (i.e. is it the ISO name as listed in that Wikipedia link)



Average of ratings: Useful (1)
In reply to Marcus Green

Re: How to map the country field with external database authentication?

by Florian Kohrt -
Thanks, that was helpful!