1

i was playing around with Assets 2.1.4 and i was wondering if there is any way of checking for no results.

My code:

{my_assets_field limit="30" offset="80"}
    <li><a href="{url}" alt="{alt_text}">{filename}</a></li>
{/my_assets_field}

Example of what i have in mind:

{my_assets_field limit="30" offset="80"}
    {if no_results} the end{/if}
    <li><a href="{url}" alt="{alt_text}">{filename}</a></li>
{/my_assets_field}

I'm doing a ajax call to this template and i need to know when i reach the end.

Thanx

0
1

I use:

{if my_assets_field}
{my_assets_field limit="30" offset="80"}
    <li><a href="{url}" alt="{alt_text}">{filename}</a></li>
{/my_assets_field}
{if:else}
the end
{/if}

But I don't know if this solution works for what you need with your ajax call.

1
  • The ajax call returned blank if no results so this was my "fix" with the javascript response. data = $.trim(data); if(data==""){ // end } I'm going to try what you did there. Thanx for the response! Aug 12 '13 at 18:59

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.