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

Navigating rows in a Grid field

How Do I?

m007's avatar
m007
83 posts
5 years ago
m007's avatar m007

Hi, I have a Grid with many rows. I want to display just a number of rows on a page and to navigate to the next page using Next/Prev buttons. It’s that possible? Thanks

       
Andrés Molina's avatar
Andrés Molina
43 posts
5 years ago
Andrés Molina's avatar Andrés Molina

Front End or Native Backend? Im newbie, but may can try some solution

       
andrew001's avatar
andrew001
136 posts
5 years ago
andrew001's avatar andrew001

If I understand correctly, it is called pagination, and yes.

Here is how I just figured it out recently. It is important to note the position of the “if count == 1” and the “if count == total_results” That is the key to making this work within the data loop.

{exp:channel:entries channel="news" limit="3" paginate="bottom"}

{if count == "1"}<div class="grid-x grid-padding-x small-up-1 medium-up-2 large-up-4 text-center">{/if}
    <div class="cell">
        <div class="cellblock text-center medium-text-left">
            <a href="http://{url_title_path=news/article}">{news_image}{img:url}{/news_image}</a>
            <h4><a href="http://{url_title_path=news/article}">{exp:chopper words="5" append="..."}{title}{/exp:chopper}</a></h4>
           {news_teaser}

            <a href="http://{url_title_path=news/article}"><i class="fa fa-caret-right"></i> Read More...</a>
        </div>
    </div>
    {if count == total_results} </div> {/if}



 <!-- the below is what creates the pagination numbers -->
{paginate}

            Page {current_page} of {total_pages} pages {pagination_links}

{/paginate}




{/exp:channel:entries}

Here is the docs. https://docs.expressionengine.com/latest/templates/pagination.html

       
m007's avatar
m007
83 posts
5 years ago
m007's avatar m007

Looks like the above example is for navigating between channel entries. I want to navigate between Grid field’s rows in a channel entry. I have a Grid field with many repeatable rows and what I want is to distribute the rows in several pages and to be able to navigate between them.

       

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.