Jump to content

Wikipedia talk:WikiProject Templates

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 72.43.99.146 (talk) at 15:56, 7 December 2016 (→‎Request for advice/consensus on templates edited by a certain IP user). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

WikiProject iconTemplates
WikiProject iconThis page is within the scope of WikiProject Templates, a group dedicated to improving the maintenance of Wikipedia's templates. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.

Does the current text of WP:BIDIRECTIONAL have broad consensus

Pls see Wikipedia talk:Categories, lists, and navigation templates#WP:BIDIRECTIONAL navbox requirements. -- Moxy (talk) —Preceding undated comment added 19:01, 19 November 2015

Making warning templates visible on mobile

I raised this as a village pump proposal last month: changing some warning templates - like {{hoax}} and {{afd}} - so that they become visible on mobile. (At the moment, all problem templates are condensed to an ignorable grey-text "Page issues" on the mobile view, even for something as ominous as an AfD'd medical advice hoax.) The templates would have to be cut down for size, perhaps only displaying the "issue=" field of the amboxes.

The proposal received unanimous support for {{hoax}} and broad support for some other templates, so I'm bringing it here to see how technically possible this would be. Is this something that can be implemented at the template level? --McGeddon (talk) 10:08, 14 October 2016 (UTC)[reply]

With no response in a month, can anyone suggest a better place to raise this? --McGeddon (talk) 16:33, 17 November 2016 (UTC)[reply]
McGeddon, this is probably the best place to ask. I honestly forgot about this post, but it was mainly due to the fact that I had other templates to edit and I wasn't exactly sure how to make templates visible on mobile. If I get a chance I'll look into it, but for the moment I think resurrecting this thread is a good start (other editors might not have seen the original post). Primefac (talk) 16:38, 17 November 2016 (UTC)[reply]

Need to bounce around some thoughts

Okay, so I'm getting sucked into merging {{runeberg.org}} and {{runeberg}} with the intention of having some sort of {{cite book}} wrapper at the end of it all. The latter was dead easy to convert (almost making me wonder why we keep it), but the former is a bit more of pain. I'm seeing somewhere in the order of 300 different possibilities for what the template could chuck out. So... I'm thinking there are a few different options:

  1. Go through the 38 transclusions of the template and manually add in the author/book/year information that's coded into the gigantic #switch statement, turning them all completely into {{runeberg}}-compatible pages.
  2. Convert each line of the #switch into its own {{cite book}} wrapper
  3. Stick the relevant information from each #switch line (author/title/date/etc) into a subpage, where those parameters would be called based on what was passed through {{{1}}}. For example, instead of having | svcohrs = [1] in Edvard Cohrs, Cohrs' atlas över Sverige (1928) I would pass "svcohrs" to the subpage and get back |origdate=1928|last=Cohrs|first=Edvard|title=Cohrs' atlas över Sverige|chapter={{{2}}}. This would be plugged directly into {{cite book}}. It will also make the main template code a lot cleaner.
  4. Nominate both templates for deletion (nuke 'em all) per this comment about its uselessness.

Options 2 and 3 are pretty much the same, it's just a question of where the information is kept, so I'm a bit torn on the best/easiest way to proceed. #3 avoids redundancy (no need to type out "cite book" 300 times), but #2 is a bit easier to see everything at once. #1 seems like a bit of a copout (besides, having a {{cite web}} wrapper with one unique parameter is hardly worth keeping), as does #4. Thoughts? Primefac (talk) 03:14, 19 October 2016 (UTC)[reply]

I would go with #1. Citation data shouldn't be stored in templates – various citations templates, including {{cite doi}}, {{cite pmid}}, and {{cite isbn}}, were deprecated for that reason. — JJMC89(T·C) 04:15, 19 October 2016 (UTC)[reply]

Requested change in template text

Per consensus at Template talk:Current weather event#Add warning?, can an editor experienced with templates change what Template:Current weather event says so it says:

"This article documents a current weather event. Information regarding it may change rapidly as more information becomes available; news reports and other primary sources may be unreliable. The last updates to this article may not reflect the most current information about this weather event for all areas; please refer to your local weather service or media outlets for the latest weather information pertaining to a specific location."

Everything that is currently wikilinked in the template ("current weather event" and "may not reflect") should remain wikilinked. I would do it myself (The template's not template-protected.), but I'm not too experienced with templates and don't want to break it. Gestrid (talk) 08:45, 23 October 2016 (UTC)[reply]

 Done See Special:Diff/745887795 and Special:Diff/745887911. — JJMC89(T·C) 23:53, 23 October 2016 (UTC)[reply]

Can someone explain to me why the template's use at Talk:Black Lives Matter makes it look the way it does? The template is used three times in a row there, and, between each one, there is a blank line. Can someone explain to me why this is happening and, if possible, fix the issue? Gestrid (talk) 15:43, 27 October 2016 (UTC)[reply]

 Fixed There was a hard return between the </noinclude> and {{main other. I've removed it. Primefac (talk) 15:52, 27 October 2016 (UTC)[reply]
Thank you! Gestrid (talk) 15:57, 27 October 2016 (UTC)[reply]

Request

I'd like to request some assistance with {{Senate of Canada}}. The issue is that while the senators' names are nominally colour-coded for party affiliation, the colours being used are so pale that for at least some users (including me) they're very nearly indistinguishable from the page background — but almost every past attempt to darken the colours to any significant degree has had to be reverted for design accessibility issues (i.e. making the text hard to read because the highlighting on it was too dark).

I've raised this for discussion at WP:CANTALK, and there's a general agreement that instead of directly highlighting the names themselves, we should switch to denoting party affiliation with a small coloured square before the name, much like what's seen on {{Current U.S. Senators}}. But because the Canadian and US Senates are structured very differently — the US has two senators per state period, while Canada has one, four, six, ten or 24 senators per province or territory — we can't simply do a straight import of the US template's method of coding the colour squares, but have to somehow find a different way to make the same thing happen.

Accordingly, I wanted to ask if someone with more experience in template coding can help us figure out a way to implement those coloured squares without futzing the overall structure of the Canadian template. Thanks. Bearcat (talk) 21:15, 27 October 2016 (UTC)[reply]

Bearcat, see Template:Senate of Canada/sandbox. Will that work for you? — JJMC89(T·C) 01:14, 28 October 2016 (UTC)[reply]
Perfect. Much thanks! Bearcat (talk) 03:33, 28 October 2016 (UTC)[reply]

Bold new template

Hi, I've boldly created a template to report suspected cases of citogenesis, as I've looked for it and it didn't exist. It's placed at Template:Circular reporting, and has the shortcuts {{citogenesis}} and {{cg}}.

What are the steps to follow from here to categorize it and make it sure that it works as intended? Diego (talk) 14:36, 3 November 2016 (UTC)[reply]

BTW I'm aware of {{circular reference}}, but I think this is a different case. {{circular}} is for cases where the linked source is clearly a site that is using Wikipedia material; but there are situations where you suspect that an otherwise reliable source is documenting a fact that was first published at Wikipedia, and want to entice editors to look for sources from an earlier date. Diego (talk) 14:50, 3 November 2016 (UTC)[reply]
Out of curiosity, Diego Moya, do you have any pages where you'll be using this, or is this a "to be used at some point" sort of template? Primefac (talk) 20:36, 3 November 2016 (UTC)[reply]
Sure. This was the motivation example, although I've since been able to fix it. The template is not in use right now, but I remember seen other cases in the past where it would have been useful, and there will likely be more in the future. Diego (talk) 23:13, 3 November 2016 (UTC)[reply]
Cool. Primefac (talk) 23:19, 3 November 2016 (UTC)[reply]

Second set of eyes on a template

I've made some changes to a template being deleted, and I could use some input. The discussion is here. Thanks. Primefac (talk) 20:33, 3 November 2016 (UTC)[reply]

Cross-posting

There is a discussion regarding interlanguage link templates here. Your input would be appreciated. Cheers, Primefac (talk) 18:45, 6 November 2016 (UTC)[reply]

Module issue

I've been working with various "games at country" templates through TFD, and they primarily use Module:Team appearances list. For some odd/stupid reason, if you add in a value for |end_year= everything breaks for the Summer Olympics (but not Winter). See Template:Infobox country Olympics/testcases for testcases (YUG's sandbox calls IB country Olympic's sandbox). I'm starting to think this is a module error, since if I don't bother with |end_year= everything works out reasonably well. I can't figure out where the issue lies (though I'm rather tired at the moment) but I could use some help if anyone knows Lua. Cheers, Primefac (talk) 05:39, 13 November 2016 (UTC)[reply]

@Primefac: Were you getting an error like "Interval is not a number: {{{app_interval}}}"? {{Team appearances list}} expects a number for its |interval= parameter, and this is passed through with the |app_interval= parameter in {{infobox country at games}}. I added the parameter to {{infobox country Olympics/sandbox}}, which should hopefully fix things. — Mr. Stradivarius ♪ talk ♪ 07:10, 13 November 2016 (UTC)[reply]
Mr. Stradivarius, that was not the error I was experiencing. |interval= is not required provided that |competition= exists (which it does). The issue I was having (which I have re-added to the testcases example above) is that when |app_begin_year= is used in combination with |app_end_year= (as seen in the sandbox version) it shows nothing for the Summer Olympics. If no parameter is passed, however, it works as intended but shows every year. Clearly neither situation is proper, and the fact that it works (in both cases) with the Winter Olympics makes me think it's an issue with the Module. Another reason why I believe this is the case is if we look at the example on Template:Team appearances list:
  • {{Team appearances list| begin_year = 1975| team = Honduras| competition = Pan American Games| 1951–71| 1983}} Gives
  • {{Team appearances list| begin_year = 1975| end_year = 2016| team = Honduras| competition = Pan American Games| 1951–71| 1983}} Gives
As soon as the end year parameter is used, it borks and shows nothing. I was looking at the module last night and in my sleep-induced haze I couldn't figure out where the trouble lay (or lie, I'm not too sure). On a related note, the whole "range of parameters" thing is bollocks - if you put a range of years in it will only grey out the first year. Primefac (talk) 16:57, 13 November 2016 (UTC)[reply]
Found where I think the problem is at Template:Infobox country at games, but fixing it by adding a pipe and previewing Brazil at the Youth Olympics gives another error: Lua error in Module:Team_appearances_list at line 126: Interval is not a number: nil.. --JohnBlackburnewordsdeeds 22:19, 13 November 2016 (UTC)[reply]
I had another few minutes to look but I have not decoded the situation. My guess is that someone is transitioning from an old system to a new system. The old system appeared to provide a list of "appearances" in the infobox, while the new system does that in Module:Team appearances list (in table COMPETITIONS). For example, Brazil at the Youth Olympics has "{{Infobox Youth Olympics Brazil}}" which calls {{Infobox Youth Olympics Brazil}}, and that has |summerappearances=... where ... is a list of three competions (2010, 2014, 2018). The module has an entry for "Summer Youth Olympics" that specifies the same years. I don't know what needs to be done to fix the old template to work with the module. The problem in the error message is that the module is not being given a competition argument, and that means it must be given parameters begin_year and interval so the module knows what to output (it would want begin_year=2010 and interval=4). I might be able to look more later, but what is needed is to find the person who has been working on the templates/modules. Johnuniq (talk) 04:36, 14 November 2016 (UTC)[reply]
JohnBlackburne, I've rolled back my recent updates to {{infobox Country Youth Olympics}}, which should eliminate the script error. I thought the errors plaguing the Olympics would be bypassed by the Youth Olympics (since it's a slightly different setup) but apparently I was wrong. Thank you for the notification. I'll do more extensive sandbox testing before re-wrapping the template.
Johnuniq, the templates are being converted to {{infobox country at games}}. At the moment the individual "country" variants hard-code the list of years, but I'm working on transitioning to the module for better automatic updates across multiple pages. I'm coding the wrappers to exclude the hard-coded parameters, so once the merge is complete those legacy parameters will disappear. Primefac (talk) 13:14, 14 November 2016 (UTC)[reply]
@Primefac: Do you want me to massage Module:Team appearances list? Some checking suggests the author is on a long wikibreak, and the module needs some tweaking. The problems it has may never be triggered in practice, but feeding it arbitrary parameters would cause it to output strange results. If wanted, I would do some edits and discuss what is needed on its talk. Johnuniq (talk) 01:24, 15 November 2016 (UTC)[reply]
Johnuniq, that sounds good. I'm watching the module and I'm happy to give input/feedback/etc on changes. From glancing at it there are definitely some issues that need resolving, but I've been primarily concerned with just making sure the "games" lists are actually in there. Primefac (talk) 01:28, 15 November 2016 (UTC)[reply]

@Primefac and anyone interested, please see Module talk:Team appearances list#Module output where I have asked what is needed. Johnuniq (talk) 04:05, 17 November 2016 (UTC)[reply]

Images in navigation templates

At User_talk:The_Banner#Images_in_Templates I am in discussion about the use of images in navigation templates. In short, the other party wants this version which I cleaned op to this version. (Identical case on [Template:Greco-Bactrian kings.

I request more people to take part in this discussion. The Banner talk 23:32, 22 November 2016 (UTC)[reply]

A navbox, a sidebar, and an infobox all walk into a room

There is a discussion regarding a set of infoboxes which fall within your purview at this location. Your input is requested and appreciated. Primefac (talk) 04:49, 28 November 2016 (UTC)[reply]

Request for advice/consensus on templates edited by a certain IP user

Hi. A few IP addresses (I believe they are all the same person or are at least working together) have over the past year edited four templates with no input from anyone else. These templates need attention because there is clearly no active community managing them. The IP user seems to be trying to improve the templates, but as can be seen from the difference between the original, simple design before they started editing and the incredibly complicated-looking design currently in place, it looks to have been made needlessly complex. I need assistance from an expert in template design.

McLerristarr | Mclay1 01:49, 7 December 2016 (UTC)[reply]

Sweet Mother Night, that diff is scary. I'll take a look and see if I can't parse out what should/shouldn't be there. Primefac (talk) 02:15, 7 December 2016 (UTC)[reply]
{{b.}} just got an overhaul. It was way too complicated for what it's supposed to do. Might expand later on but for now it's pretty similar to {{circa}}. Primefac (talk) 03:28, 7 December 2016 (UTC)[reply]
I'm going to need a third set of eyes on {{b.}}, because the IP has decided that they're right and I'm wrong. I'm starting a talk page discussion and could use further input (whether you agree or disagree with my changes). Primefac (talk) 15:33, 7 December 2016 (UTC)[reply]
It is civil to involve the other party in this discussion (myself). The OP had an WP:LIKE approach to template {{floruit}} that saw many additional transclusions after I started editing it. Apparently, other editors weren't as "confused" by my co-called "complicated" edits. I welcome your belated following of proper procedure (the talk-page discussion). 72.43.99.146 (talk) 15:56, 7 December 2016 (UTC)[reply]