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

Pagination in loop?

How Do I?

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

I am on the latest EE build (5.2.6)

Back in the v2 days I used to use string addon in an embed to pull off pagination in a loop. This addon is not available for v5

How do we pull off pagination in a data loop these days?

Thanks.

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

OK figured it out.

So, I’m just replying with my notes here, because I know I will need this later, and might help others.

Im using Foundation CSS, so the if count needs to be on the opening grid cell.

    {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>
                {exp:chopper words="15" append="..."}{news_article}{/exp:chopper}

                <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}

    {paginate}
    <div class="grid-container">
        <div class="grid-x grid-margin-x text-center">
            <div class="cell large-12">
                Page {current_page} of {total_pages} pages {pagination_links}
            </div>
        </div>
    </div>
    {/paginate}

    {/exp:channel:entries}
       
Robin Sowell's avatar
Robin Sowell
13,160 posts
5 years ago
Robin Sowell's avatar Robin Sowell

I’m still a little fuzzy on the goal, but thanks for sharing your fix. I suspect it will indeed be helpful to someone else.

       

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.