2

Is it possible to check if an Assets field is empty, using the search:fieldname attribute? I cannot use the if-method within the loop, because I'm using pagination.

Thanks, in advance! Diederik.

1 Answer 1

3

Yes you can. I just tested with this code:

{exp:channel:entries search:pt_assets="not IS_EMPTY"}
<h1>{title}</h1>
{/exp:channel:entries}

<hr />
{exp:channel:entries}
<h1>{title}</h1>
{/exp:channel:entries}

and definitely got only entries back that had Assets in the first set of entries; and all entries in the second.

I hope that helps!

1
  • Aha! That was the way I tried to do it. But, what happened was that the fields weren't emptied. The images that were selected, had been removed from Assets. Long story short, nothing was wrong with the search functionality.
    – Diederik
    Apr 29, 2013 at 12:54

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.