Bản mẫu:Infobox baseball biography/style
background-color:#DCDCDC;color:#000000;
Bản mẫu này sử dụng Lua: |
This subtemplate of {{Infobox baseball biography}} is used to generate the colored headers corresponding to the team colors for the individual's current team.
Cách sử dụng
[sửa mã nguồn]{{Infobox baseball biography/style|đội}}
hoặc
{{Infobox baseball biography/style|đội|thứ hai}}
Làm thế nào nó hoạt động
[sửa mã nguồn]The template checks to see if the team is known by checking the return code from the 'check' function in Mô đun:Baseball color. If the team is known by the module, then it will return known
, and the template uses coloring specified by either the 'colorcell' or 'colorcell2' function in Mô đun:Baseball color. If the team is not known by the module, then it will return nothing, and the template uses the coloring specified by either the 'header1' or 'header2' functions in Mô đun:College color.
Thử nghiệm
[sửa mã nguồn]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 college color module.
Thử nghiệm | Giải | Kết quả thứ nhất | Kết quả thứ hai |
---|---|---|---|
Blank | N/A | background-color:#DCDCDC;color:#000000; | background-color:#DCDCDC;color:#000000; |
Retired | N/A | background-color:#DCDCDC;color:#000000; | background-color:#DCDCDC;color:#000000; |
Free Agent | N/A | background-color:#DCDCDC;color:#000000; | background-color:#DCDCDC;color:#000000; |
Washington Nationals | US/Canada | background-color:#AB0003;color:#FFFFFF; | background-color:#11225B;color:#FFFFFF; |
Fukuoka SoftBank Hawks | Japan | background-color:#000000;color:#FFFFFF; | background-color:#FFCC00;color:#000000; |
Shanghai Golden Eagles | China/Taiwan | background-color:#ED1C24;color:#FFD400; | background-color:#ED1C24;color:#FFFFFF; |
Toros de Tijuana | Mexico | background-color:#000000;color:#FF0000; | background-color:#000000;color:#FF0000; |
Youngstown State Penguins | NCAA | background-color:#C8102E;color:#FFFFFF; | background-color:#000000;color:#FFFFFF; |
The third/fourth column in the table above should not be blank for any of the queries. Only the first three should return DCDCDC/000000 (the default).
Phức tạp
[sửa mã nguồn]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.
Xem thêm
[sửa mã nguồn]- To check if colors are known for the given team: {{GotCollegeColorsFor}}
- {{CollegePrimaryHex}} và {{CollegeSecondaryHex}}
- {{CollegePrimaryStyle}} và {{CollegeSecondaryStyle}}
- {{CollegePrimaryColorLink}} và {{CollegeSecondaryColorLink}}
- {{NCAA color}}, {{NCAA color cell}} và {{NCAA secondary color cell}}
- {{Infobox baseball biography/style}} và {{Infobox basketball biography/style}}
- {{Baseball primary style}} và {{Baseball secondary style}}
- {{NFLPrimaryColor}} và {{NFLSecondaryColor}}
- {{CBB roster/Header}}
- {{NBA color}}