We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16680
    • 73 Posts
    Hey

    Can I have multiple multi-select listboxes in one TV?

    Screenshot that illustrates the question:



    The manager template is in Danish, so don’t mind that. And yes, I made this image in Paint, since that is all I have on this work computer rolleyes

    Thanks for reading, larsb
      Signature on it's way
      • 7231
      • 4,205 Posts
      I don’t think so. Could you get away with multiple ts with one list each?
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 16680
        • 73 Posts
        Yes, that was that I tried at first, and that works just fine, but it would just look a lot nicer if I could have everything piled together in one.
        A workaround could be to have each listbox in it’s own tv, but then tweak the css to make it seem as there were only one.. hmm, looking at it now I see it’s build up by tables. That would probably need a bit more than just css tweaks I guess..
        Is it possible to call a tv from within a tv?

        larsb
          Signature on it's way
          • 16680
          • 73 Posts
          Thank you for your input GaneshXL. I tried that solution but the list gets really really long.

          I’m building a site for a bar here in Copenhagen, and the idea is that they can publish cocktail recipes and descriptions. I’m not a cocktail expert, but I would reckon that a complete list of cocktail ingredients could be very long.

          However I tried outputting the TV with checkboxes instead, like so:



          Now, as you can see in the firebug window at the bottom, a
          is inserted after each checkbox. If only you could remove that
          , you could probably float the checkboxes and make it look nice.
          I tried finding the place in the php file where the
          is inserted but I’m not very strong in php, so I wasn’t able to. I’m guessing it’s somewhere within one of these:

          manager/includes/tmplvars.commands.inc.php
          manager/includes/tmplvars.format.inc.php
          manager/includes/tmplvars.inc.php

          thanks, larsb
            Signature on it's way
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            What would happen if you did something like br {display:none;} in your css?

            Otherwise, the formatting of the fields for checkbox TVs is on line 119 of the file manager/includes/tmplvars.inc.php:
            $field_html .=  '<input type="checkbox" value="'.htmlspecialchars($itemvalue).'" id="tv_'.$i.'" name="tv'.$field_name.'[]" '. (in_array($itemvalue,$field_value)?" checked='checked'":"").' onchange="documentDirty=true;" /><label for="tv_'.$i.'">'.$item.'</label><br />';
            

            and there the
            tag is, right at the end of that line...
              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
              • 16680
              • 73 Posts
              Wohoo.. Sottwell, or let me say St. Sottwell, this works great with checkboxes laugh

              Thanks all, now I can input 49489834 values and the TV still looks good.

              larsb
                Signature on it&#39;s way
                • 4749
                • 623 Posts
                Can you take another screenshot so we can see the result? grin
                  The MODx has you...
                  Utah Web Design
                  • 16680
                  • 73 Posts
                  Sure, here you go:



                  The styling could probably be better, but this was just to test it out..

                  larsb
                    Signature on it&#39;s way
                    • 4749
                    • 623 Posts
                    Hey, that’s not too bad. May come in handy for me. smiley
                      The MODx has you...
                      Utah Web Design
                      • 7231
                      • 4,205 Posts
                      That is pretty cool. wink
                        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                        Something is happening here, but you don&#39;t know what it is.
                        Do you, Mr. Jones? - [bob dylan]