I’m not 100% sure what you’re asking, but hopefully this will answer it:
The code relates to the middle bottom page here:
https://docs.google.com/file/d/0B1SXycn_0wClOTZuVEFXenItclE/edit
On that page you can see that Artist 1 belongs to Exhibition 2, therefore we show his name.
Above his name we want to show a single Work that belongs to him. But importantly that Work MUST also belong to the current Exhibition (Exhibition 2 in the example).
In this example the Work we are showing is Work 2, because it’s the first of that Artist’s Works that belongs to Exhibition 2 (if you look at the page to the right - the detail page for this Artist in this Exhibition - you can see that the Work is called ‘Work 2’. Whereas if you look at the top middle page (a generic Artist detail page not associated with any exhibition) you can see Work 1 (purple) which we don’t want to appear on the Exhibition 2 page as it doesn’t belong to it.
The current situation is that if I use Seg2Cat then Work 1 gets picked and displayed. Alternatively if I use the IF statement (that I tried a bit higher up the page), then again Work 1 gets picked, but this time only displayed if it is of the correct category.
If I remove limit=“1”, then both methods work great, but unfortunately give me more Works than I would like.