By alkam on
Hi. Is any simple method table view shows row number (# 1, 2, 3, ....) in table as first column? I not found that field type or view type for View module. THX. Alek.
Hi. Is any simple method table view shows row number (# 1, 2, 3, ....) in table as first column? I not found that field type or view type for View module. THX. Alek.
Comments
Well, hope that this is simple enough
There may be a simpler method, but this is what works for me.
1. Create a new custom module (I just call it custom.module)
2. Put the code below in it
3. For every views that u want to add row numbering, simply add this code
-=- Jhon -=-
For Views 2 on Drupal 6
In Views 2 this has been made so simple :P
This is a simple modification from the default views theme tpl
Just put this views-view-table.tpl.php into your theme folder.
PS: Remember to clear drupal cache
EtradingGallery
-=- Jhon -=-
don't get it
sorry, but I don't get it. put the above code for views2 into views-view-table.tpl.php substiting "print $rows" part but get "Invalid argument supplied for foreach()" for the two foreach() used in php.
Well, then try to put the
Well, then try to put the original file from views/theme/views-view.table.tpl.php into your theme folder.
And then remember to clear views cache. See if it still fail on the foreach.
If it works, then the above code should work, but then I haven't got time to check it againts recent views2.
This works, but I also get
This works, but I also get this error:
Notice: Undefined variable: class in include() (line 1 of /var/www/website/sites/all/themes/drupalace/views-view-table.tpl.php).
Thanks Jhon, this just
Thanks Jhon, this just helped my out a great bunch!
http://www.kvaes.be - http://www.artistiku.com
nice tip… simply adding it
nice tip…
simply adding it to the template.php of your theme works also
The Views Custom Field module
The Views Custom Field module does that. :)
Really simple to use.
You can set rownumber field everywhere you need it.
Excellent, now why don't I
Excellent, now why don't I see that before ?
There's whole lots of small useful module out there hiding somewhere ;)
Hi Wuf, exactly! lol there is
Hi Wuf, exactly! lol there is a lot of useless module too! lol
Simple way to dispaly row no. in views 2
Add a field called 'view result counter' (under 'global' in the selection list) and move it to top position using sort.
that's perfect
+1
Simple!
+1
+1
+1