We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14883 ☆ A M B ☆
    • 450 Posts
    If I wanted to create a custom output filter snippet, and pass multiple options to it... do I basically need to use a delimited/imploded string? Like this:
    [[+sometag:myfilter=`opt1=foo||opt2=bar||opt3=baz`]]


    ...and then split it up in the myfilter snippet to get the options?

      • 28215
      • 4,149 Posts
      I’d recommend JSON, but yes.

      [[+filter:opt=`{"test":123,"otherVar":"hello"}`]]



      $options = $modx->fromJSON($options);
      $options['test']; // 123
      $options['otherVar']; // 'hello'
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 14883 ☆ A M B ☆
        • 450 Posts
        JSON would be better, yeah. But the main point is, when called in the ’as-a-filter’ syntax, the options have to be in a single string. Just wanted to make sure I wasn’t overlooking some other way of doing it.

        Thanks.