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- show just the third row?

How Do I?

From EE Slack's avatar
From EE Slack
185 posts
2 years ago
From EE Slack's avatar From EE Slack

With a grid field, what is the proper way to output only the 3rd row? With “image_grid” as the field name, I tried {image_grid row_id="3"} but nothing was output. I then discovered that the row_id of the 3rd row was actually 151 and so I changed it to {image_grid row_id="151"} and it works. But it seems odd to have to output a list of row_ids to do this. Is there a way to tell it to just output the 3rd row (for example)?

       
From EE Slack's avatar
From EE Slack
185 posts
2 years ago
From EE Slack's avatar From EE Slack

In discussion, 2 good options were found.

You can use the count in a conditional:

{image_grid}
{if image_grid:count == 3}
…content
{/if}
{/image_grid}

or you can use an offset/limit:

{image_grid offset="2" limit="1"}

…content

{/image_grid}
       

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.