We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4295
    • 98 Posts
    Hi folks,

    I downloaded the flag icons (from famfamfam.com) that are free for use on websites or apps and looked up the ISO country codes and renamed all of the icons to match the option value numbers used by MODx wherever the "Country" dropdown field appears.

    You can personalize your logged in user (who has filled in the country code) -- or as I’m doing -- adding a little flag pic in my Jot comments.

    Create a folder for the flag pics...
    [tt]assets/images/flags[/tt]

    Insert some code in the Jot "chunk.comment.inc.html" template wherever you wish the flag to appear in Jot comments...
    <br /><img src="assets/images/flags/[+comment.createdby:userinfo=`country`+].gif" title="[+comment.createdby:userinfo=`country`+]" alt="" class="floatLeft" style="padding:5px 0 0 5px;" />


    You could also use these flags to personalize the logged in user elsewhere. If you prefer png over gif, you can download from famfamfam.
      • 4195
      • 398 Posts
      nice addition smiley

      add the [TIP] prefix to your topic title  grin
        Armand Pondman
        MODx Coding Team
        :: Jot :: PHx
        • 33337
        • 3,975 Posts
        Very nice bullrat! very nice!

        Thanks for sharing this nice tip.

        best regards.

        zi
          Zaigham R - MODX Professional | Skype | Email | Twitter

          Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • 33033
          • 43 Posts
          I did this as well, another thing I did was modify the county list in websignup and webeditprofile so if a user hasn’t filled in a country it returns 0. Then I made an "international" flag as 0.gif.
            • 4195
            • 398 Posts
            a conditional only approach of the implementation of YankeeDeuce would be:

             <br />
            [+comment.createdby:userinfo=`country`:isnt=``:then=`
            <img src="assets/images/flags/[+comment.createdby:userinfo=`country`+].gif" title="[+comment.createdby:userinfo=`country`+]" alt="" class="floatLeft" style="padding:5px 0 0 5px;" />
            `:else=`
            <img src="assets/images/flags/nocountry.gif" title="no country image" alt="" class="floatLeft" style="padding:5px 0 0 5px;" />
            `+].
            
            
              Armand Pondman
              MODx Coding Team
              :: Jot :: PHx
            • I’d assume similar support for Gravatars could be done this way ... and if so anyone care to take a stab at it?
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 8881
                • 73 Posts
                What about a way to add the users photo or avatar they have on there account?