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

    MODX Revolution 2.2.10-pl (traditional)

    I'm stuck with problem-

    I have two TV for the template: COUNTRIES and CITIES.

    How can I pull all cities names depending on COUNTRIES TV selection (dropdown list input type both)?

    Another words- I choose country name and get all cities in there as a dropdown list in COUNTRIES TV.

    Thank you for all the ideas and solutions!

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

      Cheap and ready landing pages: http://real-portal.biz
      Start selling fast, good for dropshipping
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You have to somehow link the cities to their countries, making a virtual tree-like structure. Like the way resources have a "parent" field, or elements have a "category" field.

      If they're just stored in two TVs, I don't see how you could have any connection.
        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
        • 40748
        • 55 Posts
        Quote from: sottwell at Dec 26, 2013, 05:32 AM
        You have to somehow link the cities to their countries, making a virtual tree-like structure. Like the way resources have a "parent" field, or elements have a "category" field.

        If they're just stored in two TVs, I don't see how you could have any connection.

        sottwell thanks for your reply!

        I'm thinking toward direction country TV => cities chunk values => cities TV for each select option in TV dropdown.
        So if I choose some value in the country TV I get values of city names as a list in the second (cities) TV.

        May be BINDINGS will help?
          Cheap and ready landing pages: http://real-portal.biz
          Start selling fast, good for dropshipping
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Which version of MODx are you using? If you're using Revo, MIGx would be the way to go. Your Country items would each have an inner MIGx cities grid.

          I'm pretty sure Evo has a multi-grid TV extra available too, but I don't know what it is.
            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
            • 4172
            • 5,888 Posts
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Um... "Dynamic dropdown custom template variable for MODX Revolution."
                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
                • 40748
                • 55 Posts
                Quote from: Bruno17 at Dec 26, 2013, 12:10 PM
                there is http://modx.com/extras/package/dynamicdropdowntv

                Quote from: sottwell at Dec 26, 2013, 01:18 PM
                Um... "Dynamic dropdown custom template variable for MODX Revolution."

                Bruno17, sottwell,

                thank you for the idea!
                I'll try to use it
                  Cheap and ready landing pages: http://real-portal.biz
                  Start selling fast, good for dropshipping
                  • 4172
                  • 5,888 Posts
                  Here's a bit of Docu, how to use it.
                  https://github.com/Bruno17/DynamicDropdownTV

                  There are different ways.
                  You can use input-option-values
                  or processors to get the options.
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Is this for back-end? I was under the impression that this was supposed to be on the front-end.
                      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
                      • 40748
                      • 55 Posts
                      sottwell,

                      Yes, it's for back-end.
                      To use in the Manager.

                      I'm doing real-estate website. When add new real estate property you choose country first and then you get drop down list of cities of choosen country. Both listts as a TV dropdown.

                      Sorry I was not exact in my question.....
                        Cheap and ready landing pages: http://real-portal.biz
                        Start selling fast, good for dropshipping