I am using MigxDB (on MODX REV 2.2.13-pl) to create a bunch of custom galleries. I got a lot of help from this post
https://forums.modx.com/thread/90198/how-do-i-separate-a-string-of-multiple-values-from-a-tv-in-migxdb-and-wrap-each-one-in-a-chunk-to-make-a-list-of-links#dis-post-495549
But I am now running into issues using multiple &where calls. Bascially what I am trying to do is assign groups of artworks to multiple resources in migdb. This works fine. I have a column that collects resource ids and is called "exhibition_resource_id and shows them like this:
or if there are two
or a bunch
So on each of my resource pages I had the following code:
[[!migxLoopCollection?
&packageName=`artwork`
&classname=`artWorks`
&sortConfig=`[{"sortby":"title","sortdir":"ASC"}]`
&where=`{"exhibition_resource_id:LIKE":"%[[*id]]%"}`
&tpl=`tpl_artist_page`
]]
This worked great until I had over 100 resources. Then what would happen is resource 12 would also pick up items from resource 112 because of the "%" in front of the id.
So then I tried this:
[[!migxLoopCollection?
&packageName=`artwork`
&classname=`artWorks`
&sortConfig=`[{"sortby":"title","sortdir":"ASC"}]`
&where=`{"exhibition_resource_id":"[[*id]]", "OR:exhibition_resource_id:LIKE":"%||[[*id]]", "OR:exhibition_resource_id:LIKE":"%||[[*id]]||%", "OR:exhibition_resource_id:LIKE":"[[*id]]||%"}`
&tpl=`tpl_artist_page`
]]
This problem here is that instead of the where call looking for 12, ||12, ||12|| and 12||, it only finds 12||
This happens because it's the last call in my code. If I change the order it only calls whatever is last. But I need it to find the resource not matter what surrounds this. Can someone help?