I have a MIGX TV trainer which contains next to name, image, etc. a MultiSelect TV called teamsMultiSelect. The teamsMultiSelect TV is filled with the IDs of all the available team resources (field name is teams). For each trainer I can select one or more teams.
Now I want to display on each team resource all trainers which have the respective team selected in their teams TV. My thought was to filter this in the getImageList call by using the &where property, but afaik this is wrong syntax but I guess it helps to clarify my goal:
My last question was actually referring to a different project but I try to use a similar method here.
I was planning on switching to MIGXdb for this actually, I was just first testing things the (for me) simpler way. If I would have everything setup in a custom table, would I still need a custom snippet or is there a way with migxLoopCollection then?
when you set up a proper XPDO schema with a connection - table between teams and trainers, the filtering could be done with migxLoopCollection alone.
But you would need a aftersave - hooksnippet, or plugin at onDocFormSave if Resources are involved, which would resolve the entries into this connection-table after saving.
The MIGX method can get slow at some point with a lot of items.
With a many2many connection-table you can work easily in both directions.
Select/view connected teams for a trainer or select/view trainers for a team.