We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30498
    • 30 Posts
    I'd like to fill the values field for a listbox tv by means of a snippet.

    I've got the snippet and it returns eg; id==user1||id==user2

    now whats next, apparently I can't just use a runsnippet call in the values field.

    So how to do this?
      • 4172
      • 5,888 Posts
      You can use the @EVAL or @CHUNK - binding to fill inputOptionValues dynamically.

      @EVAL return $modx->runSnippet('yourSnippet',array('propertyA'=>'foo','propertyB'=>'bar'));


      or

      @CHUNK yourChunk


      and in your chunk:

      [[yourSnippet?
      &propertyA = `foo`
      &propertyB = `bar`
      ]]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 30498
        • 30 Posts
        Ah okay. Should have known :S

        using @EVAL no result shows up

        however, the @CHUNK with the snippetcall in it does work just fine. Preferred over eval anyway so problem solved.

        Thanks Bruno!