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.

Get count for current entry from a channel

July 03, 2012 8:11am

Subscribe [1]
  • #1 / Jul 03, 2012 8:11am

    Liam Crean

    121 posts

    Is there an easy way to pull and entries count in so it might display on a single entry page like

    Product 5 / 40

    Where the channel contains 40 products and this is the 5th product in the channel (when sorted by date/name/custom field etc etc).

    I’m sure there’s got to be an easy way to do this…

    Cheers, Liam

  • #2 / Jul 10, 2012 11:30am

    Liam Crean

    121 posts

    {exp:channel:entries channel="channel" orderby="title" sort="asc" dynamic="no"}
    {if segment_x == url_title}{count} / {total_results}{/if}
    {/exp:channel:entries}

    Got it working thanks to some help - assuming you know the segment of the entry url_title it can get the count and total_results.

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

ExpressionEngine News!

#eecms, #events, #releases