We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37984
    • 215 Posts
    Hey all. Typically like to puzzle through these things on my own (figuring them out teaches a lot) but I've been stuck on this issue for over a day.

    I've got a getImageList snippet call that includes the &where parameter. Here's the pertinent code bits:

    The getImageList call:

    [[!getImageList? &value=`[[+speaker-videos]]` &tpl=`videos-list-filtered` &where=`{"video-category:make_array:in_array":"formenonly"}`]]


    In this, video-category is a multi-select listbox that will by nature have more than one value. By default, this list is delimited by double pipes (||) but my understanding is that in_array won't recognize double pipes. That is the purpose of the make_array snippet; it uses str_replace to swap out the double pipes for a simple comma, and makes the TV output a comma-delimited list. Unfortunately, the only time this call works as intended is if there is only one item (that reads "formenonly") in the list. As soon as you add another item, it breaks.

    The make_array snippet:

    <?php
    $string = $input;
    $string = str_replace(array("||"), ",", $string);
    return $string;


    Anyone have any thoughts? Is it not possible to include a snippet within the &where parameter?
      Jesse Couch
      MODX Aficionado, Front-End Designer & Developer
      http://www.designcouch.com