ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Link to next category

December 15, 2011 8:28am

Subscribe [2]
  • #1 / Dec 15, 2011 8:28am

    trenkwill

    47 posts

    Hi there !

    I have a custom order for my categories (4, 6, 2, 1, 5, 3, 7). On each category page, I would like to link to the next category.

    So let’s say we’re on category page “5” I would like a link to the next category page “3” and also a link to category page “1”

    What would be the best way to do this ? I have really no clue :(


    Thanks for your help guys !

    Cheers,

    William

  • #2 / Dec 16, 2011 7:02pm

    Sean C. Smith

    3818 posts

    Hi trenkwill,

    There is no native next/prev category links in ExpressionEngine. However this shouldn’t be too hard to set up provided you don’t have a large number of categories. You could do this with a series of conditionals like this:

    {if category_id =="4"}
        <a href="/category/C6">Category 6</a>
        <a href="/category/C1">Category 1</a>
    {/if}
    {if category_id =="6"}
        <a href="/category/C2">Category 1</a>
        <a href="/category/C1">Category 1</a>
    {/if}

    And repeat until you’ve finished listing all your categories.

    Does this help?

    Sean

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases