I'm using View module to show user signup list in the event node. I'm using table in the style part. I wish to add an extra column in the table to show numbering, so that the table will shows like this:

1. Name User: Signup Time
2. Name User: Signup Time

Anyone know how to add the column to show the numbering?

Comments

Kuldip Gohil’s picture

You can use http://drupal.org/project/views_customfield to show serial number in column.

seehui’s picture

Thanks! I get what I want!

sayantan’s picture

This section needs to kept in view header section and needs to be saved as php


 $name="counter";

$value=1;

 variable_set($name, $value);

The below section needs to be added in a custom php field.

$name="counter";
$value=variable_get($name, $default);
echo $value++;
$view=views_get_current_view();
if($value<=$view->total_rows)
{
variable_set($name, $value);
}else
{
$value=1;
variable_set($name, $value);
}
seehui’s picture

This is useful to me! Really thank you for the codes!

gayatri.gadre’s picture

Thank you so much, it worked for me.