That’s a beengo! Thanks BobRay for that solution and thanks to everyone else for pointing me in the direction of some quite useful MODx education - after looking into each of the suggestions I can already see places I’ll make use of them.
The final code I ran with was
[+phx:if=`[+GraphicLink+]`:is=``:then=`<img src="[+GraphicHighlight+]">`:else=`<a href="[+GraphicLink+]"><img src="[+GraphicHighlight+]"></a>`+]
BobRay: as to why I had the separate link field, the ’ads’ are actually discrete resources in themselves, not attached to the pages that they link to. This seemed like a good idea because it allows the client to have all the ads for a page in one container and have them run in the order they are in the container. The client also plans to use scheduled publishing to make things appear/disappear in a timely fashion, so having them in one neat list to help them visualise what will happen made sense. (If you follow this and you can think of a better way, I’d be interested in hearing it). For more generic in-site ads with less control, I think I’d just use tagging of pages and use Ditto’s ability to select based on tags.
Thanks again for all your input everyone - this CMS is really, really growing on me!