<![CDATA[ Call gallery with multiple tag selection - My Forums]]> https://forums.modx.com/thread/?thread=50567 <![CDATA[Re: Call gallery with multiple tag selection]]> https://forums.modx.com/thread/50567/call-gallery-with-multiple-tag-selection#dis-post-296064
I changed the snippet code from

    $c->where(array(
        'Tags.tag' => $tag,
    ));


to

    $array_tags=explode(',',$tag);
    foreach($array_tags as &$value){
        $value = trim($value);
    }
    $c->where(array(
        'Tags.tag:IN' => $array_tags,
    ));
]]>
Alex9779 Aug 15, 2010, 07:32 AM https://forums.modx.com/thread/50567/call-gallery-with-multiple-tag-selection#dis-post-296064
<![CDATA[Call gallery with multiple tag selection]]> https://forums.modx.com/thread/50567/call-gallery-with-multiple-tag-selection#dis-post-296063
I want to make something like user specific gallery views. For that I am thinking about to have a "customers" gallery with alle the pictures in tagged with names.
To only give a user access to certain pictures I make a user setting with the tag a user can see.
My call of gallery is then
[[!Gallery? &album=`customers` &tag=`[[++alowed_tag]]`]]

This works so far.

But now I want to give pictures not only one tag but multiple and I want to set a user not with only one tag but with muliple too.

But the code of the gallery snippet only accepts one tag.

I dont wanna explode the user setting and then have multiple gallery calls.

Can someone give me a hint how to tweak the query generation in the gallery snippet to work with a delimiter seperated list of tags?

Thanks in advance.

Regards
Alexander]]>
Alex9779 Aug 15, 2010, 04:58 AM https://forums.modx.com/thread/50567/call-gallery-with-multiple-tag-selection#dis-post-296063