We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Grid Field

Development and Programming

Mauricio Dulce's avatar
Mauricio Dulce
6 posts
12 years ago
Mauricio Dulce's avatar Mauricio Dulce

Hi,

I have problem, I need not display a grid field in my template when is empy, this is the example, I need this for a secondary menu

Case 1: In this case the field not display, only happen when I use a grid field type, works fine whit others.

{exp:channel:entries channel="channel"  limit="1" disable="member_data|category_fields|pagination" }

 {if "{grid_field}" != ""} 
 {value}
 {/if}

{/exp:channel:entries}

Case 2: In this case the field display empy or not.

{exp:channel:entries channel="channel"  limit="1" disable="member_data|category_fields|pagination" }

 {if grid_field != ""} 
 {value}
 {/if}

{/exp:channel:entries}

All different types or field types works fine, but not in grid.

Tks

       
Mauricio Dulce's avatar
Mauricio Dulce
6 posts
12 years ago
Mauricio Dulce's avatar Mauricio Dulce

Ok, this work for me

{exp:channel:entries channel="channel"  limit="1" disable="member_data|category_fields|pagination" }

 {if grid_field:total_rows > 0 != ""} 
 {value}
 {/if}

{/exp:channel:entries}
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.