Wikipedia talk:Templates

Add discussion
Active discussions
WikiProject Templates  
This 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.
Wikipedia Help Project (Rated NA-class, Mid-importance)
This page is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the Help Menu or Help Directory. Or ask for help on your talk page and a volunteer will visit you there.
 NA  This page does not require a rating on the project's quality scale.
 Mid  This page has been rated as Mid-importance on the project's importance scale.

Newline stripping in template code in articlesEdit

@Ita140188: Is there a reason why some editors strip the newlines in templates in a article ? An example. I find less cumbersome to maintain (adding archiving lines or recovering dead links, etc.) the templates aligned as done for the infoboxes. Are there any rules or a consensus about that ? --Robertiki (talk) 04:21, 17 December 2018 (UTC)

@Robertiki: Hello, I am not aware of consensus on this issue (although there may be), but I find it very hard to edit an article where text is constantly cut by citations in multiple lines. I personally prefer to have a new line for each sentence with references called at the end of the sentence. Also I don't think many people edit references by hand, so I am not sure how useful this is (isn't recovering dead links/archiving done by bots?). Anyway, better still it would be to define all references (also with new lines in this case) in the references section and then only call the reference name in the body of the article. --Ita140188 (talk) 20:49, 3 January 2019 (UTC)

Should a navbox point to templates?Edit

Input would be appreciated at Template_talk:COVID-19#Pointing_to_templates. Our coronavirus navbox points to a lot of raw templates. Is that appropriate? Bondegezou (talk) 09:48, 19 February 2020 (UTC)

Refs in templatesEdit

I see Refs transcluded into articles from templates as a problem, and I have a proposal for addressing this. From the sparse content of the project page, I'm concerned that it might not be widely watched. Would this be the best venue for discussing this? If not, what would be a better venue? Wtmitchell (talk) (earlier Boracay Bill) 11:03, 11 April 2020 (UTC)

There are 248 watchers. What's the proposal? -- Michael Bednarek (talk) 12:52, 11 April 2020 (UTC)

Actually, this is one leg of a three-legged stool I have in mind. The proposal is to mandate, or at least to strongly suggest, that in templates e.g., {{efn|group={{{ref_group|upper-roman}}}|content of the footnote}} be used instead instead of using e.g., <Ref>content of the footnote</Ref>, and that {{{ref_group}}} be provided as an optional invocation parameter by templates doing this. This would allow articles transcluding templates which provide Refs to place those Refs into a group set aside for them by the article transcluding the template and expanding the Refs it produces with {{reflist|group=whatever}} under the control of the article transcluding the template.

FYI, an example (one of many) of a template providing refs is {{COVID-19 testing}}; that template provides 100+ references. It is currently transcluded by only one article, but such templates might be (commonly are) transcluded by multiple separate articles, and individual articles might have different preferences about where and how to expand the lists of references produced by transcluded templates.

The second leg of that three-legged stool would be to suggest an enhancement to the Cite extension to provide an additional optional parameter, perhaps named group-prefix, and related support for separate prefixed groups. To illustrate what I have in mind here: {{efn|group-prefix=A|group=lower-roman}} would produce a Ref group with references numbered [Ai], [Aii], etc., and {{efn|group-prefix=B|group=lower-roman}} would produce a Ref group with references numbered [Bi], [Bii], etc. This might be used to separately expand lists of Refs produced by separate templates.

(inserted) (Requested at https://phabricator.wikimedia.org/T250112) Wtmitchell (talk) (earlier Boracay Bill) 20:47, 13 April 2020 (UTC)

Wtmitchell (talk) (earlier Boracay Bill) 14:28, 11 April 2020 (UTC)

Maybe a note to this discussion at Wikipedia:Village pump (technical) would get more eyeballs here. -- Michael Bednarek ([[User taThanks. WP:VPP#Refs in templates. There had been preliminary exchanges leading to this discussion here in both of those places. Wtmitchell (talk) (earlier Boracay Bill) 07:40, 12 April 2020 (UTC)lk:Michael Bednarek|talk]]) 01:35, 12 April 2020 (UTC)
I've added mention of this discussion at WP:VPT#template parameters vs ref tag arguments and at WP:VPP#Refs in templates. There had been preliminary exchanges leading to this discussion here in both of those places. Wtmitchell (talk) (earlier Boracay Bill) 07:40, 12 April 2020 (UTC)

Do style concerns require that source citations never be transcluded from in templates until those concerns are resolved?Edit

The problem with all refs placed in article by templates is consistency of style. If the article already has fully consistent CS2 citations, for example, it is wrong to add a whole bunch of CS1 citations. References should not be added by templates unless and until there is a mechanism for adjusting styles. Peter coxhead (talk) 07:57, 12 April 2020 (UTC)
I understand your concern, it is a concern about style. WP:MOS is a guideline, while WP:V is a policy; see WP:RULES#Role. I don't think that the question of whether to cite supporting sources within templates is up for negotiation; rather, the discussion here is about how a particular proposal for how the citation of supporting sources done from within templates can be improved. Wtmitchell (talk) (earlier Boracay Bill) 16:43, 12 April 2020 (UTC)
@Wtmitchell: the "how" improvement must include fixing the citation style issue. Manually, one approach is to ensure that all templates that generate refs include a mode parameter that can be set to choose cs1/cs2, date formats, including separate ones for access & archive dates, etc. WP:V does not require templates to generate refs, only that material in articles is supported by refs, which can be added separately. Generation of duplicate refs is another problem. I do not accept that refs should ever be added to articles by templates unless and until style and duplication issues are fixed. Peter coxhead (talk) 19:50, 12 April 2020 (UTC)
I see your point, and it probably merits discussion. However, the question of whether source citations should be allowed to be transcluded from templates (they are) is irrelevant to this discussion. This discussion presumes that citations are transcluded from templates (as they often are), and concerns a specific proposal to allow them to be better handled by transcluding articles when they do appear. I've added a couple of subheadings here to separate the discussion of your point from the discussion of the proposal I've sketched out above.

Presuming that source citations are transcluded from templates, what about this proposal?Edit

Above, I've proposed cites in templates be done using something like {{efn}} but with a couple of added parameters to specify group (now) and prefix (later); both parameters being optional. It occurs to me that doing that in two stages could lead to the need for revisions in lots of templates when support for the prefix parameter appears. To avoid this, I'll suggest that a new helper template be made available for citing sources in templates; let's call it {{Tcite}} for now. It would have the group and prefix parameters mentioned previously, perhaps named or aliased to p and g for brevity, and would throw an error if the p parameter were specified before support for it appeared. So, Proposed: {{Tcite|p|g|[...]|content of citation}}, and proposed that this be mandated or strongly suggested. Discussion? Wtmitchell (talk) (earlier Boracay Bill) 13:15, 13 April 2020 (UTC)

Especially in the case of the COVID-19 articles referred to above, I'd like to avoid any more wrapper templates if possible. As an example, {{2019–20 coronavirus pandemic data}} has 292 references, and those references alone contribute 462kB to the post-expand include size (excluding the rest of the template). Adding a wrapper would essentially double that, causing a majority of the dozen or so pages that use that template to exceed the post-expand include size limit. --Ahecht (TALK
PAGE
) 22:33, 24 April 2020 (UTC)

Alternative which preserves WP:VEdit

It seems to me that the best alternative, in many cases, is keep the references on the template page and not transclude them onto the pages where the template is used. Verifiability is preserved as long as it is enforced on the template, and the article using it is not cluttered. It's similar to the situation with images, for instance a map will usually be cited on the image description page not in the article. This would not be suitable for all transclusions (for instance, text and simpler tables) but it would avoid the need to transclude massive amounts of references that are being transcluded into coronavirus-related articles in particular. buidhe 11:43, 27 April 2020 (UTC)

Yes, this is what I have previously tried to communicate. It would be a little work to set up here but it would make each of the articles much smaller. --Izno (talk) 17:03, 27 April 2020 (UTC)

I think not. The lead sentence of WP:V says: "In the English Wikipedia, verifiability means other people using the encyclopedia can check that the information comes from a reliable source." (emphasis mine). It is not reasonable to expect casual WP users to dig down into template and imagefile pages to discover whatever source citations may be present there. That would, I think, violate the spirit of V. The second paragraph of V says, "All quotations, and any material whose verifiability has been challenged or is likely to be challenged, must include an inline citation that directly supports the material." (again, emphasis mine). Not respecting that would, I think, violate the letter of V.

I think that both of these are problems which need attention, even though they look messy to solve.

The solutions I have proposed to the problem with refs in templates (the first two legs of that three legged stool I mentioned) would provide the transcluding article a large measure of control at the transcluding article level over how refs from transcluded templates are presented to the user. The third leg of that stool would do the same thing for images/files. I haven't mentioned that third leg yet or thought it out very well but, as I visualize it now, that would be to mandate that refs supporting assertions made by images be expressed in a manner that would allow them to be transcluded just like refs in templates -- preferably in the image description material. I'm guessing that it wouldn't be horribly complex to make the refs supporting file:Lab-specimens-tested.jpg transcludable as {{File:Lab-specimens-tested.jpg|optional_parameters}} (if supporting sources were cited there, that is). That would all need some discussion to get it from a first-cut proposal to something implementable, though. Wtmitchell (talk) (earlier Boracay Bill) 16:45, 3 May 2020 (UTC)

other people using the encyclopedia can check that the information comes from a reliable source Which can still be done since the template provides a convenient "see template link" in the top left corner of the template (if you must, include an <ref> after the caption of the table that makes it obvious for the interested user). If we keep the citations in the template alone, the template still has an inline citation, if we want to get into letters and spirit.
More fundamentally though, we do not build software, nor do we abuse the existing software, nor do we give leave in policy and guideline to do so, for the pathological 0.001% of cases, which is what this case is. You can make it work without any of that and have been provided multiple routes to do so. Pick one and move on. --Izno (talk) 18:56, 3 May 2020 (UTC)

Are there anyway we could create template just only for one page?Edit

I have seen a page that have unique table layout but reuse that same layout multiple times. Such as a table of information specific in that page separate by year, that layout never being used anywhere else

So I wish I could create a hidden block and then reuse that block like a template instead of duplicating the same layout or requiring to create page for new template

Is it possible?

Also, do we have a filter table? A table that could filter row by text, option, or datepicker would be great for lookup data — Preceding unsigned comment added by ThainaYu (talkcontribs) 07:43, 26 May 2020 (UTC)

Need help creating templateEdit

I'm trying to create a template for CBC Radio programs at Template:CBC Radio Programs (current and upcoming) but I've malformed the template somehow and don't know how to fix it. Can someone please help? Thanks Sowny (talk) 23:19, 6 September 2020 (UTC)

Sowny, in some of the places where template {{small}} was used, one of the two closing curly braces was missing. Fixed: Special:Diff/977101719. Consider turning on syntax highlighting in the wikitext editor—button  . —⁠andrybak (talk) 23:29, 6 September 2020 (UTC)

Group of users interested in changes to CSSEdit

Watchers of this page may be interested in Wikipedia talk:Manual of Style/Accessibility § Group of users interested in changes to CSS. Izno (talk) 22:07, 20 December 2020 (UTC)

AltitudeEdit

Is there a template that receives a geographical coordinate and returns the altitude of that point ? Otherwise, who could create template:Altitude ? --YB 13:18, 17 March 2021 (UTC)

This would require having access to DTED or similar for arbitrary coordinates, which is out of the realm of feasible for onwiki. It might be possible with an extension or in the GeoHack system that you can access when you click on the coordinates link created by {{coordinates}}. Izno (talk) 20:42, 17 March 2021 (UTC)
Thx Izno for the return. Too bad, it would be nice to have such a fonctionality for infobox templates and lists. --YB 11:00, 18 March 2021 (UTC)

Where can I talk about the template ideas?Edit

I was editing a page and I wanted to use a template that fits my purposes. But whatever I do, I couldn't find the template in my mind. I know there's a page where users can share their ideas about userbox in their mind. Does a similar thing exist?

Pinchey (talk) 18:54, 8 April 2021 (UTC)

Proposal to merge auto archiving notice into talk headerEdit

  You are invited to join the discussion at Wikipedia:Templates for discussion/Log/2021 May 13 § Template:Auto archiving notice. {{u|Sdkb}}talk 03:19, 14 May 2021 (UTC)