We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 54427
    • 6 Posts
    The code below, I'm trying to use another image if there is no HeroImage, it shows the HeroImage, but does not does not show blogImage just image not found. Is there a tweak for the below?

    or is this not possible, trying to do it in this way? thanks

    <img src="[[*HeroImage:isempty:then='[[*blogImage:phpthumbof=`w=1200&h=800`]]':else='[[*HeroImage:phpthumbof=`w=1200&h=800`]]']] [[*]]" alt="[[*pagetitle]]" class="img-responsive"/>
    
    
      • 38783
      • 571 Posts
      Have you tried calling your TV uncached with ! before the name.

      <img src="[[!*HeroImage:isempty:then='[[*blogImage:phpthumbof=`w=1200&h=800`]]':else='[[*HeroImage:phpthumbof=`w=1200&h=800`]]']] [[*]]" alt="[[*pagetitle]]" class="img-responsive"/>
        If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

        email: [email protected] | website: https://andytough.com
        • 54427
        • 6 Posts
        Quote from: andytough at Jul 26, 2018, 05:04 AM
        Have you tried calling your TV uncached with ! before the name.

        <img src="[[!*HeroImage:isempty:then='[[*blogImage:phpthumbof=`w=1200&h=800`]]':else='[[*HeroImage:phpthumbof=`w=1200&h=800`]]']] [[*]]" alt="[[*pagetitle]]" class="img-responsive">


        Just tried still same issue
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          Note the difference between ' and ` quotes - MODX needs the latter.

          What I'd recommend is this:

          <img src="[[*HeroImage:default=`[[*blogImage]]`:phpthumbof=`w=1200&h=800`]]" alt="[[*pagetitle]]" class="img-responsive"/>
          
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 38783
            • 571 Posts
            Should it be back ticks where you have single quotes?

            <img src="[[*HeroImage:isempty:then=`[[*blogImage:phpthumbof=`w=1200&h=800`]]`:else=`[[*HeroImage:phpthumbof=`w=1200&h=800`]]`]] [[*]]" alt="[[*pagetitle]]" class="img-responsive"/>
              If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

              email: [email protected] | website: https://andytough.com
              • 54427
              • 6 Posts
              Quote from: andytough at Jul 26, 2018, 05:27 AM
              Should it be back ticks where you have single quotes?

              <img src="[[*HeroImage:isempty:then=`[[*blogImage:phpthumbof=`w=1200&h=800`]]`:else=`[[*HeroImage:phpthumbof=`w=1200&h=800`]]`]] [[*]]" alt="[[*pagetitle]]" class="img-responsive">

              That didn't make any difference I'm afraid
                • 54427
                • 6 Posts
                Quote from: markh at Jul 26, 2018, 05:27 AM
                Note the difference between ' and ` quotes - MODX needs the latter.

                What I'd recommend is this:

                <img src="[[*HeroImage:default=`[[*blogImage]]`:phpthumbof=`w=1200&h=800`]]" alt="[[*pagetitle]]" class="img-responsive">
                


                Thanks a million this works, in some strange illogical hard to fathom way wink