User:Betty Logan/Sandbox/Template:Highest-grossing films franchise/doc

This template generates a table entry for the franchise chart at List of highest-grossing films. Each entry contains a collapsible table for the franchise, which when expanded will display the films included in the franchise. A franchise may contain more than one series, which when expanded will show an entry for each series. Each series included in the franchise will also be a collapsible table which when expanded will show the films in the series.

Parameters
type – franchise/series/film default: series; selects the type of table entry. sub – yes; indicates whether the entry is a sub-table. Initiates the yellow shading for sub-tables. rank – 1/2/3...etc; position in chart. title – title of the franchise/series. total – 1000000000; the total gross of the franchise/series. This is automated for series, but has to be manually set for franchises. Enter the number as a raw figure, the template will format it i.e. 1000000 will format to i.e. $1,000,000 totalnote – sometimes it is necessary to include a source for the data; totalnote accompanies total in the table. number – the number of films in the franchise series. This parameter along with "total" needs to be set to calculate the average for the franchise/series. highest – the highest grossing film in the series franchise i.e. Foo gross – the gross of the highest grossing film in the series. For example, if you set "highest" to Foo, then "gross" can be set to 1000000. release – yes/1/2/3...etc; indicates whether the franchise/series is currently in release. Initiates the blue shading commonly seen in the table. Stipulating an entry number will add shading to the entry that correlates to that number in the table i.e. the number 3 will add shading to the third entry in the table.

Series
The most common form of franchise entry is a series. This may be a sequence of films that share a continuity or a production background. An example of this would be the rebooted Batman series; as can be seen in the example, the total and average are calculated automatically. The total can be set manually by setting the "total" parameter, and blue highlighting can be added by setting the "release" parameter:



Franchise
A franchise may contain several series. In the case of the Batman franchise, there are three distinct series that have been exhibited theatrically: the Nolan series, the 1989–1997 series, and the animated series which included just a single film. In the example below, "type" is set to "series" for the series that contain mulitple films, and to "film" for the animated series, while it is set to "franchise" for the main table entry. The "series" and "film" distinction turns off the collapsible mode which is not needed for series that contain just a single film. The totals for each series are calculated automatically, but an editor must enter the overall franchise total:



Sub-franchises
A franchise isn't restricted to just containing series, it can also contain sub-franchises, which in turn can include series or further sub-franchises. This is done by setting "type" to "franchise" in the franchise sub-table. This will be a rare scenario for most series, but can be used to add further organisation to franchises. Taking the Batman franchise example, it may be desirable to break the original series down by director:



Limits
A series can hold up to 50 films. A franchise can hold up to 10 series/sub-franchises. Each limit applies only at the level, so a franchise could contain ten sub-franchises, which in turn could each contain ten series, which could each hold up to fifty films each. The limits have been chosen to allow for plenty of franchise "growth", but can easily be extended if required. In theory, a franchise entry could contain up to 37 levels, the limit the software imposes. However, it is likely that the table would become unreadable before that stage, let alone the fact that a scenario that requires that level of refining is unlikely to ever occur. It is not known at which level it becomes impractical to add another level, but as a guide, the Batman sub-franchise example only has three levels of tables. An analogous example could see further refining by actors, and possibly another level beyond that for spin-offs in the case of some franchises, requiring five levels, and the chart is easily readable to this level.

Updating totals
In the case of series tables, the task of calculating the total is automated. Totals for franchises and sub-franchises have to be manually added. The easiest way to do this, is to type in the film grosses, and use the preview function so you can see what the series totals are. This will leave the franchise total without a value:

The three totals can then be copied into the franchise table from which the franchise total can be calculated using a summation formula (making sure you enter the amounts in unformatted raw form): total= Saving this will transclude the franchise total into the table, so the table will look like the one in the second example above. This process will also work for sub-franchises too, working up from the bottom level, one level at time, harvesting the totals and entering them into summation formulas. The alternative method is to work out the totals yourself and enter them directly, but calculating the totals yourself is more subsceptible to error.

Consensus
This template has been designed for usage on a particular article. While it is available to use on other articles, please do not make any alterations that will adjust it aesthetically or functionally, without discussing it first at Talk:List of highest-grossing films. The examples used on this template do not represent a consensus for how this data should should be organised; that is for the article editors to determine, in conjunction with the various policies and guidelines. The form the examples take here are purely to demonstrate functionality. On the same note, these examples should not be altered to mirror the structure of organisation on the article, since they are constructed to highlight the differences in functionality.

Technical issues
Due to wikicode rendering in different ways in different browsers, if you tweak something it is best to check it in several browsers. Internet Explorer is the main one, but Firefox, Chrome, Safari and Opera are all popular browsers too.