Using assets in a Matrix field, and would like to display 'no results' if a file has not been uploaded for that particular field. Like so...

{exp:channel:entries....etc} {matrix_field} {field_1} {field_2}

{if asset_field}
    No Files


I've tried various combinations of using total_results and changing where the conditional is, complex/simple. Can't seem to find the right combination that works with both cases. Is there a no_results tag? What's the proper way to do this?

2 Answers 2


I just did a quick setup to test. My matrix tag pair is test_matrix. My Assets column is matrix_assets

{exp:channel:entries limit="2"}
<h1>{title}, {entry_id}</h1>
{if matrix_assets == ""}nada{/if}
{if matrix_assets != ""}stuff{/if}

I did that with two entries, one with that column populated, one without. This was the output of that template:

testing matrix assets - has no file, 15

testing matrix assets - results, 14


So you can see the conditionals there are working. Can you give that type of approach a shot?

  • I'm not sure what was going on earlier, but that did do it, as it should have!
    – Blair
    Mar 14, 2013 at 5:59

You can accomplish this one of two ways...

{if file}{file}{if:else}no results{/if}

Or, if you're trying to show the "no results" if no matrix rows exist, you could do this...

{if total_rows == "0"}no results{/if}

or this...

{if matrix_field == ""}no results{/if}

Let me know if you have questions!

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.