We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29838
    • 8 Posts
    I’m getting used to Revolution syntax and still haven’t figured out some of the ways things are done. All I am trying to do, is check if a variable is not empty, in order to use it in some HTML. The variable is of image type. I am storing this code in a chunk which is being called by wayfinder. The second line of the following code seems to fail:

    <li[[+wf.id]][[+wf.classes]]>
    [[+mainImage:notempty=`<img src="[[+mainImage]]?h=150&zc=1" class="image-right" alt="[[+wf.title]]" height="150" />`]]
    <h2><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a></h2>
    [[+introText]]
    <p><a href="[[+wf.link]]" class="more" title="[[+wf.title]]" [[+wf.attributes]]>Read more ></a></p>
    [[+wf.wrapper]]
    </li>

    MODx:
    * v2.0.3
    * Snippets ran: wayfinder
    * Plugins ran: PHPThumb

    Browser/Client:
    * Firefox v3.6.10
    * Mac OS v10.6.4
      • 3749
      • 24,544 Posts
      How does it fail, exactly? No output ever, or what?
        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
        • 29838
        • 8 Posts
        It outputs nothing, as if the variable is empty. Without the conditional wrapped around it however, mainImage returns a value. This leads me to believe the there is an error in the syntax.
          • 1778
          • 659 Posts
          Hello

          You have an error in the syntax that can cause the issue :

          In your code on the line

          <p><a href="[[+wf.link]]" class="more" title="[[+wf.title]]" [[+wf.attributes]]>Read more ></a></p>

          You have a superflu ">" just after "Read more" (in red)

          Hope it helps
          Cheers
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            If you want to use that as an "arrow", you should use &gt; instead.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org