Fieldtype

Archived
Forum
(read-only)

Catchall

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Tom Jaeger

     

Can you check if fields have data before displaying?

General

artmem
artmem

With regular custom fields, I know you can use {if custom_field}{custom_field} content{/if} to only display the data if there is content in the field. Is there a similar method for the individual parts of the catchall array?

Rob Sanchez
# 1
Rob Sanchez

You should be able to do this:

{exp:channel:entries channel="your_channel"}
    {your_catchall_field}
        {if 
"{your_sub_field}" != ""}Sub Field{your_sub_field}{/if}
        {sub_fields}
            {if 
"{your_sub_sub_field}" != ""}Sub Sub Field{your_sub_sub_field}{/if}
        {
/sub_fields}
    {
/your_catchall_field}
{
/exp:channel:entries}