Jump to content

Wikipedia:Templates for discussion/Log/2018 April 5

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Retro (talk | contribs) at 01:22, 6 April 2018 (Template:Bad: Expanding this.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

April 5

Red and green table highlights

Propose redirecting Template:Bad to Template:No.

Propose redirecting (or deleting if consensus is in favor) Template:Available and Template:Contained to Template:Yes Compare the appearance:

Template Total transclusions No-parameter transclusions
Bad 192 3 (user-space)
No 3981 n/a (2,648)
Available 107 1 (mainspace)
Contained 105 4 (2 mainspace, 2 userspace)
Yes 5407 n/a (3,849)

Note: The transclusions on Template:Table cell templates/doc were not included in the above transclusion counts.

The number of no-parameter transclusions is the most relevant number for this request. It shows that the proposed templates are very rarely used to display the default text, which makes them functional duplicates of the more popular highlighting templates. This also means the redirect (or deletion) can be very easily implemented, only replacing the text on a handful of pages.

It's a duplicate of {{no}}, aside from a barely noticable color difference (#faa vs. #F99). This color change to {{bad}} was made by Telpardec made an edit to lighten the background for better contrast ratio with non-black foreground. This is relevant to the discussion. If the consensus is to forward the change to {{no}}, this could be implemented.

I was in a hurry when I originally made this request, and made a few formatting mistakes which Pppery nicely corrected; the relevant discussion is collapsed below. Revised and broadened 01:21, 6 April 2018 (UTC)) E to the Pi times i (talk | contribs)

Discussion about fixing formatting with Pppery
@Pppery: Oh! It was my edit to {{Bad}} that caused the erroneous merge template formatting! Thanks for fixing it; I'll definitely avoid making such an error in the future, now that I'm aware of it. E to the Pi times i (talk | contribs) 21:03, 5 April 2018 (UTC)[reply]
(edit conflict) A large number of unrelated things went wrong there leading to the mess.
  1. Your edit to {{bad}} broke the template by making it include the open table tag that it shouldn't.
  2. {{bad}} and {{no}} don't work when used directly, but only when inside of tables (that's what produced the style="background: #faa; color: black; vertical-align: middle; text-align: center; " nonsense. )
  3. You can't include two open curly brackets in a row in the middle of a template without escaping them (\{{2} in the regex did that). (that's what made the template not subst)
  4. Your signature has a displayed vertical bar in it. As it says in the relevant section of your preferences, Note: to use a displayed pipe ("|") character (i.e. not part of a piped link), please use | for the pipe character; it can otherwise cause templates to fail., which only didn't cause a huge wikimarkup mess because of the previous problem.
  5. Table markup can't be used inside templates without escaping it. (You didn't try to do this, I had to tackle this issue when resolving the problem)
{{3x|p}}ery (talk) 21:11, 5 April 2018 (UTC)[reply]
@E to the Pi times i: {{3x|p}}ery (talk) 21:16, 5 April 2018 (UTC)[reply]
@Pppery: How do you escape curly brackets in templates? E to the Pi times i (talk | contribs) 21:20, 5 April 2018 (UTC)[reply]
{{((}} or <nowiki>{{</nowiki>, although in my case it was easier to rewrite the regex to avoid the bad combination. {{3x|p}}ery (talk) 21:21, 5 April 2018 (UTC)[reply]
(edit conflict) @Pppery: I note my sig is now substed. Did you change that? Does having it substed have any benefits over transclusion? E to the Pi times i (talk | contribs) 21:25, 5 April 2018 (UTC) Never mind, thanks for the policy link though. E to the Pi times i (talk | contribs) 21:29, 5 April 2018 (UTC)[reply]
I changed nothing, although there is a guideline against using templates in signatures. {{3x|p}}ery (talk) 21:27, 5 April 2018 (UTC)[reply]
Correction: your search is specific to article space. There are three userpages using {{bad}} without parameters. {{3x|p}}ery (talk) 21:32, 5 April 2018 (UTC)[reply]
Yeah, I was about to correct that. I was sorting out my sig business. But those can easily be changed, and the template obviously duplicates the functionality of {{no}}. E to the Pi times i (talk | contribs) 21:36, 5 April 2018 (UTC)[reply]
@Pppery: Okay, just wanted to give a heads-up on reviewing the problems with my previous edits. #1 and #2 were obvious, and could have been gleaned from more closely reviewing {{bad}} and {{no}} (I especially shouldn't have deleted that <noinclude> in {{bad}}, though its not a highly-transcluded template (~200 or so transclusions), so fortunately minimal harm was done. If the template more transclusions, I would have done testcases before requesting edit.) For #3, I'll be sure to keep the {{ in mind when crafting future regex; I only use that scheme instead of \{\{ because it's slightly more efficient on some regex engines. Regarding #4, I missed that in my preferences, it has since been corrected. #5 seemed weird at first but it makes sense now (obviously, it's because of the | being interpreted as pipes.) I appreciate your help greatly. In theory, I am not this scattered normally. E to the Pi times i (talk | contribs) 21:52, 5 April 2018 (UTC)[reply]

Comment: E to the Pi times i (talk | contribs) 23:48, 5 April 2018 (UTC)[reply]