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

Using Pagination with Categories

How Do I?

loupage's avatar
loupage
3 posts
4 years ago
loupage's avatar loupage

Is there a way to paginate a list of categories? For example, I have 9 categories and would like to display 3 categories with their description on each page. It seems like it should be as easy as the following, but no luck.

{exp:channel:categories limit="3" paginate="bottom"}
    <a href="http://{path=channel/index}">{category_name}</a>
    {if category_description}{category_description}{/if}
 {paginate}
        {if previous_page}
            <a href="http://{auto_path}">Previous Page</a>  
        {/if}
        {if next_page}
            <a href="http://{auto_path}">Next Page</a>
        {/if}
    {/paginate}
{/exp:channel:categories}
       
Rob Allen's avatar
Rob Allen
2,950 posts
4 years ago
Rob Allen's avatar Rob Allen

Not natively, categories are generally used for classifying channel entries.

What I’ve done in the past that’s broadly similar is use a special “categories” channel where you add one entry per channel - you can then use a channel entries tag to output information and paginate as needed.

The other approach is to use relationships rather than categories for classifying stuff.

       
loupage's avatar
loupage
3 posts
4 years ago
loupage's avatar loupage

That was my fallback plan, but I was hoping for solution using categories. What we have are sermon series, each with 3-6 sermons. So I want a list of series, but don’t want to show more that 3 or 4 per page.

       
Rob Allen's avatar
Rob Allen
2,950 posts
4 years ago
Rob Allen's avatar Rob Allen

I’d definitely go for channel entries and relationships for that sort of structure.

       

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.