Last updated October 15, 2010. Created by Alun on April 7, 2010.
Log in to edit this page.

Setting up a League table in Views is the easiest view to start with. We will have a number of fields, sorts and filters, outlined below

Fields
Here, you can outline what fields you want in your league table.
Typical fields would be;
The team name, which is Node:Title
Leaguesite Standings: Points Scored
Leaguesite Standings: Games Played
etc...
If you wish to add custom field worked out from other fields (eg to work out win percentage) you can add the fields, hide them from the view and then use the following module to calculate values using PHP - http://drupal.org/project/views_customfield

Sort
For the tables, you will need to sort by points. You can also sort by games played and points for, if you have a secondary sort in mind, should two teams have the same number of points.

Filter
Because you are displaying teams, you will first need to sort by Node:Type and restrict to leaguesite_team
You will then need to filter by Season, to ensure that only one seasons standings are displayed.
If you wish to sort by the current season (so the view updates when the season ends) there is a filter provided.
Finally, you will need to filter by league, to ensure that only one league's standings are displayed.

Arguments & Relationships
No arguments or relationships are needed here, unless you want to use arguments to display the leagues. E.g. standings/1 gives you the league with ID 1, standings/2 gives you the league with ID 2... etc. You will obviously need to set up a View displaying the Leagues to link to the created view so that the arguments are supplied.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.