We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37832
    • 7 Posts
    Guys — THANK YOU! Sorry about the school boy error, I'm over the moon about this, Bruno17 thanks for MIGX It's great!
      • 7858
      • 97 Posts
      Hi, i cann't solve some problem.

      I use migx to let user select several resources via resource list TV. But how can i render resource names, based on resource id's? I think i have to add a function to migx.tpl, but what a function? Now the user sees only the resource ids, looking on migx grid...
        • 13218
        • 134 Posts
        I couldn't tell you how to extend migx functionality to achieve this, but...

        A dirty work around though would be this:
        your resource list TV probably has a format like this:
        My first page==23||Some other page==43||Last Page==12

        The migx grid only shows the selected values like 23 or 43.
        If you change that format to this:
        My first page==[23] My first page||Some other page==[43] Some other page||Last Page==[12] Last Page

        the migx grid would show these values: [23] My first page / [43] Some other page

        When you process the selected values for further use (using the id to call a resource), you would have to extract the relevant id from the string with something like like this:
        $id = substr( $migxstring, 1, strpos( $migxstring, ']' ) - 1 );


        You see, it's a quick and dirty workaround, but it puts the resource's pagetitle into the migx grid and still provides its id for further use.
          @itWilllBeOK
          • 4172
          • 5,888 Posts
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 13218
            • 134 Posts
            This is of course much prettierer!

            Just one tiny little thing: the 'renderSecond' snippet could return wrong value if the pagetitle would include a : of its own.
            So maybe use this as 'renderSecond', just to be sure?
            <?php
             
            $val = explode(':',$input);
            return array_pop($val);
              @itWilllBeOK
              • 37213
              • 25 Posts
              Hi all migx users,

              I have a question about a field combination in migx.
              1) a dropdown (tv.dropdown is used @SELECT, to get users name from modx)
              2) a textfield

              Both are user name field [both not required], when an user name is not in the dropdown list, the user can add the name in the textfield.

              my idea is:
              if (dropdown) {
              use the name from dropdown
              } else (textfield) {
              use the filled name
              }

              I want to know or this is possible in migx? Anybody that can give me a direction for this?
              Thanks for your help...

              Using:
              MODX Revolution 2.1.3-pl (traditional)
              migx 1.1.0
                • 7858
                • 97 Posts
                Hi guys, thx for answers... but i cann't understand, how I can change

                My first page==23||Some other page==43||Last Page==12


                to

                My first page==[23] My first page||Some other page==[43] Some other page||Last Page==[12] Last Page


                if I use tv type Resource List...
                  • 4172
                  • 5,888 Posts
                  you will need a dropdown-tv with @eval-binding input-options. You can use
                  return runSnippet('getResources',$params);
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 4172
                    • 5,888 Posts

                    my idea is:
                    if (dropdown) {
                    use the name from dropdown
                    } else (textfield) {
                    use the filled name
                    }

                    I would do the opposite:

                    [[+textfield:isnot=``:then=`[[+textfield]]`:else=`[[+dropdownfield]]`]]

                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                      • 37213
                      • 25 Posts
                      @Bruno, thanks to give me on the right direction. Your solution will solve my issue laugh

                      I have one more question, don't know or this is the right area to ask. Do you know or it is possible to have an empty field in the drop down list when I'm using @SELECT. Thanks for your kindly help..

                      This discussion is closed to further replies. Keep calm and carry on.