We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5143
    • 116 Posts
    I'm using MIGX to generate a list of entries on a page, but not all of the fields in MIGX will always be filled in and I want to hide any sign of them when they're blank.

    I tried using PHx with "notempty", but it didn't seem to work. I'm now trying MODX's "If" add-on, but this isn't doing what I want either. Please see the code below:

    <li>
        <h3>[[+title]]</h3>
        <span class="Date">[[+startDate]] - [[+endDate]]</span>
        [[+info]]
        [[If?
        &subject=`[[+link]]`
        &operator=`is`
        &operand=`notempty`
        &then=`<a href="[[+link]]" class="cvLink">Link</a>`
        &else=``
        ]]
    </li>


    This outputs nothing, regardless of whether there's an entry for "+link" or not. What am I doing wrong? [ed. note: chr.s last edited this post 14 years ago.]
      • 10208 ☆ A M B ☆
      • 1,780 Posts
      Try with just &operand=`notempty`, omit &operator.

      I'm not sure you need &else either.
        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 5143
        • 116 Posts
        Hey, thanks for the tip - but it doesn't work for me.

        I tried every combination of your suggestions, but no joy.

        Edit: Found out the issue was MIGX outputting "--" for any empty entries. very odd, but have now compensated. [ed. note: chr.s last edited this post 14 years ago.]