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.

Variable to Keep Track Counting??

September 28, 2010 9:30pm

Subscribe [2]
  • #1 / Sep 28, 2010 9:30pm

    Daniel Suliman

    22 posts

    Hi,

    Is there a way to have variable, i.e. {my_count} where I can keep on adding by 1 (one) everytime it is being called for. Example:

    {my_count} = 0

    {exp:channel:entries}
    ...
    {my_count} = {my_count} + 1
    ...
    {/exp:channel:entries}

    I do not want to use PHP function if possible for this purpose.

    Thanks

  • #2 / Sep 28, 2010 10:55pm

    Cheif

    626 posts

  • #3 / Sep 28, 2010 11:55pm

    Daniel Suliman

    22 posts

    Cheif,

    What if in the case that it is outside the {exp:channel:entries} function? Basically, it’s general variable for counting purpose.

  • #4 / Sep 29, 2010 12:03am

    Cheif

    626 posts

    As it’s outside the core functionality of the system ie outside of entries tag, you’ll have to rely on good ol fashioned PHP or JS.

    Maybe if you can give us a heads up on what you’re trying to achieve some more light may be shed.

  • #5 / Sep 29, 2010 1:37am

    Daniel Suliman

    22 posts

    Cheif, yes I guess I don’t have much choice in this. Thanks.

  • #6 / Sep 29, 2010 3:11pm

    Ingmar

    29245 posts

    This would require some PHP, I am afraid. Moving to the CodeShare Corner.

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

ExpressionEngine News!

#eecms, #events, #releases