Template talk:Sent off
Whitespace
[edit]This template has some whitespace issues, which I can't see how to fix:
{{sent off}}test ->
test
{{sent off|1}}test ->
test
{{sent off|2}}test ->
test
{{sent off|0|27}}test ->
27'test
{{sent off|1|67|88}}test ->
67'
88'test
{{sent off|2|23|60}}test ->
23'
60'test
Ideally, there should be no space between the template's output and the "test" text. This is needed to make the template align properly when used in a {{footballbox}}. ——StuartBrady (Talk) 13:31, 4 October 2007 (UTC)
- I should have spotted this earlier, but from the above, it looks as though the use of the span tag is causing the problem. Any ideas? ——StuartBrady (Talk) 13:54, 4 October 2007 (UTC)
- The whitespace (and associated alignment) problem is caused by the forced image overlap of the yellow and red card. Currently the image
uses two image files, File:Yellow card.svg and File:Red card.svg, and shifts their positioning onto each other creating the problem. This problem can be fixed by uploading and using a single svg file for a yellow-red combo. Bobby (talk) 23:38, 28 August 2011 (UTC)
- The whitespace (and associated alignment) problem is caused by the forced image overlap of the yellow and red card. Currently the image
- Is
acceptable? If so, can anyone who knows how to update the template? Not sure if there is a single then direct red card image though. One95 (talk) 21:33, 4 March 2012 (UTC)
- Is
- On Win7/IE9, the above example of {{sent off|2}} appears correctly (i.e. no whitespace between 60' and "test"). On what OS/browser are you seeing the problem? DH85868993 (talk) 01:48, 31 July 2012 (UTC)
- I also have no problem with any whitespace, and I'm using Google Chrome on Windows 7. – PeeJay 17:59, 31 July 2012 (UTC)
- (copied from User:One95's talk page) I've had alignment problems with Win7/Firefox and XP/Firefox. One95 (talk) 22:19, 31 July 2012 (UTC)
- no alignment problems on Linux/Firefox. Frietjes (talk) 16:28, 1 August 2012 (UTC)
- (copied from User:One95's talk page) I've had alignment problems with Win7/Firefox and XP/Firefox. One95 (talk) 22:19, 31 July 2012 (UTC)
- I also have no problem with any whitespace, and I'm using Google Chrome on Windows 7. – PeeJay 17:59, 31 July 2012 (UTC)
- On Win7/IE9, the above example of {{sent off|2}} appears correctly (i.e. no whitespace between 60' and "test"). On what OS/browser are you seeing the problem? DH85868993 (talk) 01:48, 31 July 2012 (UTC)
As noted above, I don't see any whitespace between the minutes and the word "test", but I do see a space between the bullet and the "{{" on the 1st, 2nd and 5th lines above, but not in the 3rd, 4th and 6th lines, even though the wikicode at the start of each line is the same. Also, if I expand the Vancouver vs Victoria friendly in 2012 Vancouver Whitecaps FC season, the line containing the {{sent off}} looks OK, but the following line is shifted to the left, such that the 'a' in Watson lines up with the 'D' in 'Davidson'. Does anyone else see that? DH85868993 (talk) 23:13, 1 August 2012 (UTC)
- That's the alignment problem I was referring to. One95 (talk) 12:09, 2 August 2012 (UTC)
- OK. We got there eventually. I have requested help at WP:VPT. DH85868993 (talk) 13:15, 2 August 2012 (UTC)
- That's because there is an unclosed html element at the end. I have removed it now in the sandbox version and moved the testcases to a separate page.
- OK. We got there eventually. I have requested help at WP:VPT. DH85868993 (talk) 13:15, 2 August 2012 (UTC)
Description of current problem
[edit]Trancluding {{sent off|2}} causes the line following the transclusion to be shifted to the left - see the template documentation page (or the Vancouver vs Victoria friendly in 2012 Vancouver Whitecaps FC season) for an example. The problem seems to be caused by the template overlaying two images - we have a "combined" image () but don't know how to incorporate it into the template. DH85868993 (talk) 13:29, 2 August 2012 (UTC)
- You will also need images for all the other multicard versions. What maded the 2 card version work was causing invalid HTML as described just above. —TheDJ (talk • contribs) 14:23, 2 August 2012 (UTC)
- Might have found a trick to make it work without composed images. Template:Sent off/testcases The sandbox version now seems to work for me on Safari, Chrome and Firefox. If someone could confirm for a couple of versions of IE, then I think we can deploy this. —TheDJ (talk • contribs) 14:37, 2 August 2012 (UTC)
- Template:Sent off/testcases looks OK on both IE8 and IE9. DH85868993 (talk) 14:41, 2 August 2012 (UTC)
Done deployed. —TheDJ (talk • contribs) 14:56, 2 August 2012 (UTC)
- Thank you very much for your help. DH85868993 (talk) 15:02, 2 August 2012 (UTC)
- Template:Sent off/testcases looks OK on both IE8 and IE9. DH85868993 (talk) 14:41, 2 August 2012 (UTC)
- Might have found a trick to make it work without composed images. Template:Sent off/testcases The sandbox version now seems to work for me on Safari, Chrome and Firefox. If someone could confirm for a couple of versions of IE, then I think we can deploy this. —TheDJ (talk • contribs) 14:37, 2 August 2012 (UTC)
(edit conflict × 5) The spaces between the image and following text were there in 2007, when the original complaint was made. This was "fixed" in June 2010 by introducing the unclosed span noted above, which caused the following lines to be incorrectly offset left in some cases. Fix looks good.
But I see another, unrelated issue: The files File:Red card.svg and File:Yellow card.svg are licensed GFDL and CC-BY-SA, both of which require a link back to the description page for attribution. I've removed the link suppression. If you want to restore the link suppression, relicense the images (they're probably {{PD-shape}}, IMO) or replace them with public-domain or CC-0 versions. Anomie⚔ 15:04, 2 August 2012 (UTC)
0, 1, 2 ?
[edit]The 0, 1, 2 options and associated icons are misleading. Comparing
with
it looks visually, from the tooltip, and from the numbers 2 and 1 in the wikicode as though the former is "worse" than the latter; i.e. that a player received three cards (yellow, yellow, red) compared to two (yellow, red). Whereas that's strictly accurate, in that referees brandish the second-yellow and then the red, that is part of a single event, not two distinct events/fouls. TV graphics often show animations like the second yellow card sliding in beside/over the first and then magically transmogrifying into a red; that would be difficult and inappropriately irritating for Wikipedia. I think better would be to use one of commons:Category:Yellow-red card icons; e.g.
for second-yellow vs
for yellow + straight-red. jnestorius(talk) 09:58, 11 July 2018 (UTC)
- @Jnestorius: Speaking from a technical side, it wouldn't be difficult to implement, so if there is staggering support for this, I could implement it. However, while I agree that it could potentially irritate people visually, I think basic knowledge of football rules should usually clear that up: no one receives two yellow cards without being sent off and only later a straight red, and equally, no one receives yellow-red on their first booking. Lordtobi (✉) 14:29, 16 July 2018 (UTC)
- apologies, could you clarify: I'm not sure whether the change you are willing to implement is the irritating animation, which I don't support, or the simple use of a yellow-red icon, which I do support. My basic point remains that it is difficult for readers to work out the difference between the two current icons (or groups of icons). I speak from experience: the first time I even realised there were two different icons was when trying to interpret the table in 2018 FIFA World Cup Group H#Discipline, and even then it took a while. Yes, based on knowing the rules I was able to work it out, but it took a while, and I believe the split yellow-red icon would have been easier to interpret. jnestorius(talk) 20:48, 16 July 2018 (UTC)
- To clarify: I mean the simple bi-colored card showing instead of a yellow and a red one when the amount of yellow cards is set to >= 2. I'll keep myself neutral on whether it should be implemented or not, but I suggest you hit up the associated WikiProject(s) to ask for additional opinions, as changing this would affect most if not all footballing pages of the past 50 or so years. Lordtobi (✉) 21:28, 16 July 2018 (UTC)
- Fair enough. I've raised at Wikipedia talk:WikiProject Football#Template:Sent off and Wikipedia talk:WikiProject Rugby union#Template:Sent off. jnestorius(talk) 21:58, 20 July 2018 (UTC)
- To clarify: I mean the simple bi-colored card showing instead of a yellow and a red one when the amount of yellow cards is set to >= 2. I'll keep myself neutral on whether it should be implemented or not, but I suggest you hit up the associated WikiProject(s) to ask for additional opinions, as changing this would affect most if not all footballing pages of the past 50 or so years. Lordtobi (✉) 21:28, 16 July 2018 (UTC)
- apologies, could you clarify: I'm not sure whether the change you are willing to implement is the irritating animation, which I don't support, or the simple use of a yellow-red icon, which I do support. My basic point remains that it is difficult for readers to work out the difference between the two current icons (or groups of icons). I speak from experience: the first time I even realised there were two different icons was when trying to interpret the table in 2018 FIFA World Cup Group H#Discipline, and even then it took a while. Yes, based on knowing the rules I was able to work it out, but it took a while, and I believe the split yellow-red icon would have been easier to interpret. jnestorius(talk) 20:48, 16 July 2018 (UTC)
- I think we should stay with the current set up. Using the
symbol is potentially much more confusing as it appears that a third "half and half" card was issued to the player. I agree with the issue identified on three card symbols for two offenses but this is a relatively standard notation. Skeene88 (talk) 09:01, 21 July 2018 (UTC)
- @Skeene88: "this is a relatively standard notation" — I don't believe that it is and would need to see some evidence of what sites use this notation. I compared David Luiz (yellow+stright-red 17 Sep 2017) with Ben Chilwell (second-yellow 13 Jan 2018) and found the following:
- The Guardian [1],[2] and Eurosport [3],[4] use same icons for both cases; (ditto ESPN Boateng v
BoatengMangala) - Premier League [5],[6] uses something like
for straight-red and
for Second-yellow
- BBC [7] uses same for yellow+straight-red as for no-yellow+straight-red (e.g. [8]; i.e. {{sent off|1}} same as {{sent off|0}})
- The Guardian [1],[2] and Eurosport [3],[4] use same icons for both cases; (ditto ESPN Boateng v
- jnestorius(talk) 06:49, 23 July 2018 (UTC) [updated jnestorius(talk) 11:50, 23 July 2018 (UTC)]
- So, not to ask the stupid question, but why not change it to the variant as given by Jnestorius above? Primefac (talk) 22:52, 23 July 2018 (UTC) (please ping on reply)
- Since the template is widely used, then even if there is a consensus to change it [which I'm not sure there is yet], we should try to get it perfect first time rather than tweak and re-tweak it. jnestorius(talk) 09:56, 24 July 2018 (UTC)
- So, not to ask the stupid question, but why not change it to the variant as given by Jnestorius above? Primefac (talk) 22:52, 23 July 2018 (UTC) (please ping on reply)
- @Skeene88: "this is a relatively standard notation" — I don't believe that it is and would need to see some evidence of what sites use this notation. I compared David Luiz (yellow+stright-red 17 Sep 2017) with Ben Chilwell (second-yellow 13 Jan 2018) and found the following:
- I've created a sandboxed version of the mixed-card system, you can compare the results on the testcases page. Lordtobi (✉) 12:38, 23 July 2018 (UTC)
- Thanks. A few suggestions, some may be more complicated to code (1) add space (2) use full-width card for first yellow, not thin 3) have the time beside the relevant card (3) maybe the red-over-yellow icon is better than the diagonal-split icon.
- jnestorius(talk) 09:56, 24 July 2018 (UTC)
- I prefer the alternative version of 2 with the two cards overlaid rather than the diagonal split. – PeeJay 12:31, 15 October 2018 (UTC)
- @Jnestorius: Can this be implemented now? – PeeJay 10:06, 25 October 2018 (UTC)
- It's edit protected. I don't have permissions but I support the change. jnestorius(talk) 10:05, 2 November 2018 (UTC)
- jnestorius(talk) 09:56, 24 July 2018 (UTC)
@Jnestorius, Skeene88, Primefac, and PeeJay2K3: Due to limited participation (in contrast to the template's high usage) I take the current state as weak consensus. I've updated the sandbox, please review Template:Sent off/testcases. If this is the desired format I can take it live.
- @Lordtobi: Looks good to me, although I question the necessity of the third yellow card parameter (i.e. {{sent off|3}}). A player would only be issued with a third yellow card by mistake before being sent off (see here), and the only time I can think of when this has happened, one of the yellow cards was retconned out of existence. – PeeJay 11:28, 2 November 2018 (UTC)
- PeeJay2K3, earlier this year I implemented the #3 parameter specifically for the Simunic case, as it comes to good use there (even if nowhere else). Obviously, it won't be used anywhere else but it keeps the format aligned in the given case.
- Okay, fair enough. As I said, though, FIFA have since retconned the cad out of existence, so we probably shouldn't be mentioning it on here anyway, except as a note surrounding the controversy. Officially, Simunic only received two yellow cards. – PeeJay 12:16, 2 November 2018 (UTC)
- PeeJay2K3, earlier this year I implemented the #3 parameter specifically for the Simunic case, as it comes to good use there (even if nowhere else). Obviously, it won't be used anywhere else but it keeps the format aligned in the given case.
- Looks fine to me. Some cases are wider than the current equivalents, so if some uses are in tables with fine-tuned sizings they could uglify the format. Since such fine-tuning is discouraged in any case, I don't consider that reason to hold off. jnestorius(talk) 19:07, 2 November 2018 (UTC)
- Right. Template's live. Lordtobi (✉) 19:28, 2 November 2018 (UTC)
- The changes seem to be working pretty well. I've not seen any errors or anything in the last month. Great stuff, Lordtobi! – PeeJay 10:00, 4 December 2018 (UTC)
- @Lordtobi: Would it be possible for the template to display only the sending off minute for
{{sent off|2}}
on certain articles? For example, for articles on older competitions such as 1999 DFB-Pokal Final, only the minute of the second yellow card is known. This causes an issue currently on that page with Mario Basler. Thanks, S.A. Julio (talk) 23:15, 25 April 2019 (UTC)- S.A. Julio, thanks for the heads-up, the if checks were actually broken in the template. I believe to have fixed it, and your requested format should now work by leaving the relevant parameter blank:
{{sent off|2||114}}
→
Lordtobi (✉) 06:28, 26 April 2019 (UTC)114'
- S.A. Julio, thanks for the heads-up, the if checks were actually broken in the template. I believe to have fixed it, and your requested format should now work by leaving the relevant parameter blank:
- Right. Template's live. Lordtobi (✉) 19:28, 2 November 2018 (UTC)
Template-protected edit request on 4 November 2018
[edit]![]() | This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
This template generates a missing end tag for <span>
every time it is used. This is because the template begins
<span style="white-space:nowrap;">
and has no closing tag. It would seem that the solution is to place </span>
just before <noinclude>
. —Anomalocaris (talk) 03:49, 4 November 2018 (UTC)
Done — JJMC89 (T·C) 06:29, 4 November 2018 (UTC)
- JJMC89: Thanks! —Anomalocaris (talk) 07:37, 4 November 2018 (UTC)