We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29802
    • 36 Posts
    I’m conceding defeat!

    How can I display the text value of the country field (modx_web_user_attributes)?

    I only get a number.

    I’m presuming that number is a key to its value but I can’t find the list of countries in the DB. The only list I can find is in the includes/lang folder.

    I’m using 0.9.6 BTW

    Many thanks.
      • 29802
      • 36 Posts
      I know, I’m bumping it. Only because I’m at a dead-end which has effectively brought me to a halt though.

      Anyone any ideas? Am I missing an API call, for instance?
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        /manager/includes/lang/country/

        Personally, I hate these lists that use a number. It’s no more difficult to make up a list that uses the ISO code (de, etc...) for the key.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 29802
          • 36 Posts
          Thanks Scotwell.

          I figured the value must be coming from those, but how do I display the country value?

          [+country+] just displays a number.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Looks like you’ll have to do some code to map the numbers to their country names. Unless somebody else knows a better way.

            Something like include the array, put the number in a variable, and get $_country_lang[$countrykey].
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 29802
              • 36 Posts
              Thanks again Scotwell.

              I thought there might be an easier way, alas!

              Cheers