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.

absolute_count absolute_results

March 25, 2011 11:13am

Subscribe [3]
  • #1 / Mar 25, 2011 11:13am

    lisab

    2 posts

    How do i display number of entries as text string {absolute_count} or {absolute_results} without duplicating the value in the exp: channel tag? The page uses pagination.

    ex: total number of classes:
    {exp:channel:entries channel="bioclass" disable="member_data|trackbacks" }
    {absolute_results}
    {/exp:channel:entries}

    displays:
    total number of classes: 5 5 5 5 5

  • #2 / Mar 25, 2011 1:32pm

    Mark Bowen

    12637 posts

    Give this a try and see if it does what you need :

    {exp:channel:entries
        channel="bioclass"
        disable="member_data|trackbacks"}
    
    {if count == "1"}{absolute_results}{/if}
    
    {/exp:channel:entries}

    Best wishes,

    Mark

  • #3 / Mar 25, 2011 2:19pm

    lisab

    2 posts

    Perfect. Thank you.

  • #4 / Mar 25, 2011 3:17pm

    Mark Bowen

    12637 posts

    No problem. Glad that got it sorted for you.

    Best wishes,

    Mark

  • #5 / Apr 01, 2011 6:19am

    So_Interactive

    44 posts

    Hi, the above example does not work for me. I am trying to display the total amount of entries to a single channel. Problem is that it repeats the count from 1 to 10 eg:

    Code:
    {exp:channel:entries channel="document_repository" }
    {absolute_count}
    {/exp:channel:entries}

    Output:
    1 2 3 4 5 6

    I need the final amount which is 6.
    Assistance would be greatly appreciated.
    Thank you
    Nathaniel

  • #6 / Apr 01, 2011 7:15am

    Mark Bowen

    12637 posts

    Hi Nathaniel,

    Try this in your instance :

    {exp:channel:entries channel=“document_repository” }
    {if count == total_results}{total_results}{/if}
    {/exp:channel:entries}

    Hope that helps a bit.

    Best wishes,

    Mark

  • #7 / Apr 01, 2011 7:45am

    So_Interactive

    44 posts

    YAY, dude you rock - thanks it works. They should put this into the manual as the manual is very unclear on how to actually use single variables. Anyway, thanks again.
    Nathaniel

  • #8 / Apr 01, 2011 8:10am

    Mark Bowen

    12637 posts

    No problem at all.

    Glad that got things sorted for you.

    Best wishes,

    Mark

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

ExpressionEngine News!

#eecms, #events, #releases