How can I display a number count in views, for example if I am listing all the members of the site in list view how would I display a 1 next to the first name a 2 next to the second and etc. Is there an option for this? Thanks.

Comments

merlinofchaos’s picture

Status: Active » Fixed

Use the HTML List style and set the type to Ordered.

clarkwolfe’s picture

Status: Fixed » Active

I'm sorry, I did not mean list view, I should of said table view. It's very convenient for members to be able to see a table view of other members and their contact information and I love how Views makes this work. Is there a way to number a view with the Style: Table. I don't believe there is, but was wondering if anyone had a workaround? Thanks!

merlinofchaos’s picture

Status: Active » Fixed

You'll have to theme the view and add the numbering yourself. This is doable fairly readily with the table template.

clarkwolfe’s picture

Status: Fixed » Active

Thanks for the help. Would this template be the "views-view-table.tpl.php" file located under the theme folder of the views module? If so the php code is very short, with the variable I want displayed named "$count" I believe. Would anyone know how to actually display that count on the table much like in the list view when you select ordered list. Thanks!

clarkwolfe’s picture

I figured it out, with a little PHP help from some friends. Thanks for your help. Now I can number all of my tables no matter how they are sorted.

clarkwolfe’s picture

Status: Active » Fixed

I figured it out, with a little PHP help from some friends. Thanks for your help. Now I can number all of my tables no matter how they are sorted.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

tommytom’s picture

Could you share your PHP code ?

calefilm’s picture

What's the point of asking us a question and then saying "I figured it out!" but not adding the solution