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.

Showing on first few 'categories' in the navigation

July 12, 2012 8:38am

Subscribe [1]
  • #1 / Jul 12, 2012 8:38am

    suvasishm

    4 posts

    Hi,

    I’ve a list of say 10 categories in my category group. I want to show only first 8 categories from them. But don’t want to delete other 2 as I may need them at some other time.

    Following is my code:

    {exp:channel:categories channel="products"}
      <a href="http://{path=%27product/index%27}">{category_name}</a>
    {/exp:channel:categories}

    and I want to do something like

    {exp:channel:categories channel="products" limit="8"}

    . But “limit” is not supported in this tag.


    Please suggest me any alternate solution.

    Thanks in advance!

  • #2 / Jul 12, 2012 8:49am

    suvasishm

    4 posts

    Okay it seems I have a solution as follows:

    {exp:channel:categories channel="products"}
      {if count <=8}
        <a href="http://{path=%27product/index%27}">{category_name}</a>
      {/if}        
    {/exp:channel:categories}

    Any other solution is appreciated!!

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

ExpressionEngine News!

#eecms, #events, #releases