Template:Infobox basketball biography/style: Difference between revisions

Jump to navigation Jump to search
(Created page with "{{Documentation subpage}} {{High-use}} {{Lua|Module:Sports color|Module:College color}} This subtemplate of {{tl|Infobox basketball biography}} is used to generate the colored headers corresponding to the team colors for the individual's current professional team. == Usage == :{{tld|Infobox basketball biography/style|''team''}} or :{{tld|Infobox basketball biography/style|''team''|''team_link''}} == How it works == The template checks to see if the team is known by ch...")
 
No edit summary
 
Line 1: Line 1:
{{Documentation subpage}}
{{#if:{{#invoke:sports color|check|sport=basketball|{{{1}}}}}
{{High-use}}
  |{{#if:{{{2|}}}|[[{{{2}}}|<span style="{{#invoke:sports color|colorcell|sport=basketball|simple=1|1={{{1}}}}}">{{{1}}}</span>]]|{{#invoke:sports color|colorcell|sport=basketball|simple=1|1={{{1}}}|border={{{border|}}}}} }}
{{Lua|Module:Sports color|Module:College color}}
  |{{#if:{{{2|}}}|[[{{{2}}}|<span style="{{#invoke:college color|header1|1={{{1}}}}}">{{{1}}}</span>]]|{{#invoke:college color|header1|1={{{1}}}|border={{{border|}}}}}}}
 
}}<noinclude>{{documentation}}</noinclude>
This subtemplate of {{tl|Infobox basketball biography}} is used to generate the colored headers corresponding to the team colors for the individual's current professional team.
 
== Usage ==
:{{tld|Infobox basketball biography/style|''team''}}
or
:{{tld|Infobox basketball biography/style|''team''|''team_link''}}
 
== How it works ==
The template checks to see if the team is known by checking the return code from the 'check' function in [[Module:Sports color]].  If the team is known by the module, then it will return <code>known</code>, and the template uses coloring specified by the 'colorcell' function in [[Module:Sports color]].  If the team is not known by the module, then it will return nothing, and the template uses the coloring specified by the 'header' function in [[Module:College color]].
 
If a second ''team_link'' parameter is passed, this style statement is used to generate a colored link, otherwise the template simply returns the style statement.
 
== Tests ==
The following are tests to make sure the template has not been broken.  The tests check the last team in a few sections of the module, and in the NCAA color template.
 
{| class="wikitable"
|-
! Test !! League !! Result
|-
| Blank || N/A || {{Infobox basketball biography/style|}}
|-
| Retired || N/A || {{Infobox basketball biography/style|Retired}}
|-
| Free Agent || N/A || {{Infobox basketball biography/style|Free Agent}}
|-
| Washington Wizards || NBA || {{Infobox basketball biography/style|Washington Wizards}}
|-
| Žalgiris Kaunas || Euroleague || {{Infobox basketball biography/style|Žalgiris Kaunas}}
|-
| Wollongong Hawks || NBL || {{Infobox basketball biography/style|Wollongong Hawks}}
|-
| Talk 'N Text Tropang Texters || PBA || {{Infobox basketball biography/style|Talk 'N Text Tropang Texters}}
|-
| Smart Gilas Pilipinas || PBA || {{Infobox basketball biography/style|Smart Gilas Pilipinas}}
|-
| s.Oliver Baskets || European leagues || {{Infobox basketball biography/style|s.Oliver Baskets}}
|-
| Wonju Dongbu Promy || KBL || {{Infobox basketball biography/style|Wonju Dongbu Promy}}
|-
| South Korea national basketball team || KBL || {{Infobox basketball biography/style|South Korea national basketball team}}
|-
| Youngstown State Penguins || NCAA || {{Infobox basketball biography/style|Youngstown State Penguins}}
|-
| Moncton Magic|| Canada || {{Infobox basketball biography/style|Moncton Magic}}
|-
|Raleigh Firebirds|| The Basketball League||{{Infobox basketball biography/style|Raleigh Firebirds}}
|}
The third column in the table above should not be blank for any of the queries.  Only the first three should return DCDCDC/000000 (the default).
 
== Complexity ==
In principle, more leagues could be added, but there is a risk that this would increase the module's complexity, and either (a) reduce rendering speed, or (b) trigger the dreaded script error.
 
== See also ==
* To check if colors are known for the given team: {{tl|GotCollegeColorsFor}}
* {{tl|CollegePrimaryHex}} and {{tl|CollegeSecondaryHex}}
* {{tl|CollegePrimaryStyle}} and {{tl|CollegeSecondaryStyle}}
* {{tl|CollegePrimaryColorLink}} and {{tl|CollegeSecondaryColorLink}}
* {{tl|NCAA color}}, {{tl|NCAA color cell}} and {{tl|NCAA secondary color cell}}
* {{tl|Infobox baseball biography/style}} and {{tl|Infobox basketball biography/style}}
* {{tl|Baseball primary style}} and {{tl|Baseball secondary style}}
* {{tl|NFLPrimaryColor}} and {{tl|NFLSecondaryColor}}
* {{tl|CBB roster/Header}}
* {{tl|NBA color}}
 
<includeonly>
<!-- categories go here -->
 
</includeonly>

Latest revision as of 20:34, 8 April 2024

background-color:#DCDCDC;color:#000000;