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

    Is there any way to create a dummy "-" blank option on a Listbox (Single Select) TV?

    I see this works on Input Type: Resource List but not on type Listbox (Single Select)

    I have created a dropdown with
    Input Type: Listbox (Single Select)
    Input Option Values: @SELECT name AS `name`,`id` FROM `modx_people` WHERE `published` = 1 AND `deleted` = 0
    (this selects people database records from a MIGxdb table I have created)

    This works fine but I really need there to be a "-" blank option as the first on the option list.

    Is this possible?

    thanks

    Ian

    (Revolution 2.3.1)
      • 4172
      • 5,888 Posts
      I'm using migxLoopCollection to build listbox-items like

      @EVAL return '-==||' . $modx->runSnippet('migxLoopCollection',array('packageName'=>'yourPackage','classname'=>'yourClass','tpl'=>'@CODE:[[+name]]==[[+id]]','outputSeparator'=>'||'));


      or use
      @CHUNK getInputOptions


      and create a chunk with migxLoopCollection - snippet - call in it.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 46584
        • 29 Posts
        Many thanks Bruno, that worked perfectly