Last active
December 18, 2015 20:49
-
-
Save ijy/5842992 to your computer and use it in GitHub Desktop.
Conditionally check whether a Matrix is empty when searching on a particular column. Can be used with a Playa relationship field.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {if '{parent:total_rows search:child="not IS_EMPTY"}' == 0} | |
| ... | |
| {/if} |
Author
Here's an example of how it might look using the :total_rows and search in an EE conditional
{if "{matrix_field:total_rows search:column_name=''search term here"}
{matrix_field search:column_name=''search term here"}
<p>{col_names} … etc.</p>
{/matrix_field}
{if:else}
{other_custom_field}
{/if}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the search:col_name= parameter in combination with :total_rows:
Where 'parent' is the matrix field name and 'child' is the matrix column name.