2

I have a simple Matrix field inside Low Variables. All I want to do is display a message when there are no results, but the conditional isn't working.

Am I doing something wrong?

{exp:low_variables:pair var="friends"}

    {if no_results}
         <p>Coming Soon</p>
    {/if}

<div class="span4">
    <ul class="span4 unstyled text-center">
       <li>{name}</li>
       <li>{special}</li>
       <li><a href="{link}">Website</a></li>
   </ul>
</div>

{/exp:low_variables:pair}
1

Matrix doesn't have a no_results variable. You'll have to just see if the LV field is empty instead. Try this.

{if '{exp:low_variables:pair var="friends"}{name}{exp:low_variables:pair}' == ''}
  <p>Coming soon.</p>
{/if}
{exp:low_variables:pair var="friends"}
  {name}
  {special}
{/exp:low_variables:pair}
| improve this answer | |
  • 1
    Thanks Stephen, it almost worked, I just needed to change it to a single variable: {if '{exp:low_variables:parse var="friends"}' == ''} <p>Coming soon.</p> {/if} – Jon Wright May 10 '13 at 14:12
  • Cool. Glad you got it. – Stephen Callender May 10 '13 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.