We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13808
    • 61 Posts
    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!
      • 3749
      • 24,544 Posts
      Looks perfect. Glad you got it sorted. laugh
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting