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

    Description of Problem:
    My question is a two-parter.
    1. Why is &useIsoCode=`0` not working?
    2. If there is no solution, how can I make the ISO Code values lowercase?


    PART 1!
    I don't think the useIsoCode parameter is working in my FormitCountryOptions Call. Here it is:

    [[!FormItCountryOptions? &selected=`[[!+fi.country]]` useIsoCode=`0` &prioritized=`US,GB,DE,RU,JP,FR,NL,CA,AU,UA`]]
    


    Somebody came across this issue in Bug Tracker..but it's from two years ago and it says that it's solved which doesn't help my situation: http://bugs.modx.com/issues/5240

    Expected Outcome:
    Currently, this is what the markup of the Country dropdown looks like:
    <select name="country">
    <optgroup label="Frequent Visitors">
        <option value="AU">Australia</option>
    <option value="CA">Canada</option>
    <option value="FR">France</option>
    <option value="DE">Germany</option>


    Btu I want it looking like this:
    <select name="country">
    <optgroup label="Frequent Visitors">
        <option value="Australia">Australia</option>
    <option value="Canada">Canada</option>
    <option value="France">France</option>
    <option value="Germany">Germany</option>


    I can't find a solution anywhere apart from that Bug Tracker page which doesn't actually help me.

    PART 2! - IF THE useIsoCode PARAMETER WON'T WORK
    Is there anyway to switch the ISO Code values from uppercase to lowercase? My client doesn't want the ISO Code appearing on the site. So maybe I can just replace the ISO Code with a cool flag.

    Thanks to a tip here from the forums (http://forums.modx.com/thread/42998/tip-inserting-flag-of-user-s-country-in-jot-comments) I downloaded the FamFamFam flag icon set. But all of the file names are lowercase so my "img src" can't pull up the image since the value from Formit is uppercase. One solution is to rename all of my file names to lowercase, but that is a LOT of work if I do it manually!

    Expected Outcome:
    I want to be able to call up the Country in lowercase like this:
    <img src="assets/images/flags/au.gif"/>

    But currently it's like this - which just comes up with a broken image because the actual image file is "au.gif":
    <img src="assets/images/flags/AU.gif"/>



    Thanks for any help!
    Sar



    • MODX Version: MODX Revolution 2.2.7-pl (traditional)
    • PHP Version: 5.3.24
    • Database MySQL Version: 5.5.30-cll
    • Formit Version: 2.2

    This question has been answered by garryn. See the first response.

      ☆ Flag it! - Don't forget to "star" a reply if it's answered your question smiley
    • discuss.answer
      So, on part 1, you are missing the & sign before the parameter, it should be:
      &useIsoCode=`0`


      For part 2, if you need it after that, you could use an output modifier to handle the lowercase conversion - I'm presuming you have the country code as some kind of placeholder, in this example I've used isoCode as the name of the placeholder:

      [[+isoCode:strtolower]]

        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com
        • 44985
        • 27 Posts
        Quote from: garryn at Sep 03, 2013, 03:41 AM
        So, on part 1, you are missing the & sign before the parameter, it should be:
        &useIsoCode=`0`


        For part 2, if you need it after that, you could use an output modifier to handle the lowercase conversion - I'm presuming you have the country code as some kind of placeholder, in this example I've used isoCode as the name of the placeholder:

        [[+isoCode:strtolower]]


        What in the world. I can't believe I overlooked that! And yes...now it works with the apersand!

        And thanks for the lowercase tip. It works great too! Thanks heaps, Garry.

        Sar
          ☆ Flag it! - Don't forget to "star" a reply if it's answered your question smiley