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.

RfC on templates storing data[edit]

The following discussion is an archived record of a request for comment. Please do not modify it. No further edits should be made to this discussion. A summary of the conclusions reached follows.
The majority of the participants felt that it either was acceptable to store data in the template space or that it should be dealt with on a case by case basis; with no outright consensus for "yes, all data templates must be kept", the status quo of dealing with potentially problematic templates via the TFD process shall be maintained. Primefac (talk) 23:29, 20 April 2019 (UTC)Reply[reply]

Is storing data an acceptable use of template namespace? ((3x|p))ery (talk) 23:35, 15 March 2019 (UTC)Reply[reply]

Background: Zackmann08 has recently nominated a large number of templates that are used to store multiple pieces of data, each intended to be used on only one article, for deletion. These have ended in inconsistent results:

  1. Wikipedia:Templates_for_discussion/Log/2019_February_15#Template:Metadata_population_AT-9 closed as delete
  2. Wikipedia:Templates_for_discussion/Log/2019_February_22#Metadata_population_AT_templates closed as delete (although this was kind of a fait accompli since the templates had been orphaned during the discussion).
  3. And there are many currently open, often with the !votes heading in opposite directions despite the arguments for keeping v. deleting generally being the same.

Feel free to tweak the above list. Thus, I am presenting this issue to a wider discussion. ((3x|p))ery (talk) 23:35, 15 March 2019 (UTC)Reply[reply]

Survey[edit]

Storing data in a template like this creates a number of problems.
1) Ease of access What this means is that if a user wants to update the information (say for example the population), rather than editing the page, just like every other article on Wikipedia, they have to track down the sub template that is being called and then understand how the switch statement works and find the right value to change. For those of us experience with template editing, this is no problem. But Wikipedia is meant to be open for anyone to use. Storing data in this way just makes it more difficult to update.
2) Outdated references with invalid dates If right now I update the value of Imatra's population, I have to update it on ((Infobox Finnish municipality/population count)). First, lets assume I am using the same reference as the one that is provided. Well now my access date needs to be updated to today's date. But I'm only updating one value... If I change the reference, I am saying that ALL the values are current as of today's date. But that isn't the case, I'm only updating one value. Furthermore, what if I'm using a different source? I am locked in to using the same source as every other value on the page because that is the source that is being returned by the template.
3) Dangerous precedent Additionally this sets a dangerous precedent. Should we next create a ((Chembox/boiling point)) that contains a massive switch statement with the boiling point of every chemical? Or ((Infobox NFL team/coach)) with a switch statement containing the current coach of every NFL team? That isn't how this works. If you want to change the data, you change it on the article in question.
4) Performance issues With the current implementation of 20 different subtemplates, that means that any time one of these articles loads, it has to parse 20 different switch statements. In somecases, because of the way the error handing is written, the switch statements are parsed multiple times. All to return plaintext numbers or references that can and should be included directly on the page.
The only reason I have heard for keeping these templates is that it makes it easier to update. Well that is just false. It may make it easier to BULK update, but how often are you updating EVERY value in one go? Rarely... And if it needs to be done, WP:BOTs are your answer for bulk updating pages. --Zackmann (Talk to me/What I been doing) 23:37, 15 March 2019 (UTC)Reply[reply]
If thousands of boiling points or NFL coaches were changed at least once a year on the same day by the same organization, probably we would have a meta template for them. --eh bien mon prince (talk) 00:51, 16 March 2019 (UTC)Reply[reply]
Underlying lk, read that as boiling points of NFL coaches. cygnis insignis 10:52, 16 March 2019 (UTC)Reply[reply]
There is a spectrum of abilities and of needs in curating data for use in Wikipedia articles. Our most valuable resource is committed editors and we should retain the flexibility to use whatever solution is preferred by the editors curating that data. It's not our place to impose our own preferences on them. --RexxS (talk) 11:52, 16 March 2019 (UTC)Reply[reply]
  1. Re #1: sometimes, data in templates provides ease of access.
  2. Re #2: look at the template's edit history and ask someone to update the entire template if you can't do it yourself.
  3. Re #3: a contrived example, akin to 'ladders exist, so how should someone get to the 100th floor of a building, use a bunch of ladders?'. No, take the stairs, i.e. Wikidata. ((Wikidata)) and other similar templates exist for this purpose, and can be used in satisfy said examples.
  4. Re #4: WP:DWAP.   ~ Tom.Reding (talkdgaf)  12:32, 16 March 2019 (UTC)Reply[reply]
Ynhockey (Talk) 19:32, 16 March 2019 (UTC)Reply[reply]

Discussion[edit]

Is watching a single page on Commons really not possible? If that is the only hurdle, it wouldn't be difficult to create a public watchlist program that logs a page on Enwiki every time the Commons page is changed (filtered for bots). Then anyone can watchlist the log page. BTW I love your idea to "move toward a situation where data is stored in a central location and is processed by an efficient, fully-featured language" .. unfortunately we have a minority who believe a "fully-featured language" is a detriment for the majority. -- GreenC 15:06, 20 March 2019 (UTC)Reply[reply]
The discussion above is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.

Excerpts[edit]

I note the use of Wikipedia:Excerpts conflicts with Wikipedia:Template namespace#Guidelines which says "Templates should not normally be used to store article text". ((Excerpt)) doesn't store the text in a template per se, but it seems the guideline should be updated to mention this practice as an exception, if there is consensus to do so. -- Beland (talk) 18:52, 3 August 2020 (UTC)Reply[reply]

It's not an exception; it's just a template that makes labelled section transclusion a little easier. "Using a template to store article text" can be seen in places like Special:Diff/660435790, where the entirety of the text was replaced by a template that had the same content. Using an excerpt (via the template or LST) can be seen at the 2011 version of the same article family - the opening paragraph is copied from the pre-2009 article instead of being stored in a template or needlessly duplicated on the article itself. Primefac (talk) 19:05, 3 August 2020 (UTC)Reply[reply]

Modules in namespace[edit]

At Wikipedia:Templates for discussion/Log/2021 April 10#Template:UTF-16 the question of direct invocations of modules in mainspace came up. I've seen the question before and I feel like it would be a good idea to write it down. I feel like it's a best practice to not systematically use direct module invocations (((#invoke:Example))) in the mainspace. Instead a template wrapper should be created and be used in the documentation. This is to make it as simple as possible to use the module without forcing non-technical editors to learn about the invoke magic word, the difference between the template and module namespace and prevent syntax confusion. This shouldn't be a hard rule but rather something to point to when the question comes up. My suggestion would be adding a modules section under the "Suggested practices" heading. It could read something like:

Lua modules are sometimes used instead of templates to store reusable material. Reasons includes usage of module exclusive features such as loops or complicated features being easier to maintain in the shape of a module. If a module is easily implementable in a template it generally should be since there are more users with experience editing templates. If a module is intended to be used in articles a template wrapper should generally be created to simplify usage without requiring the invoke parser function. This syntax should also be used in the documentation.

What do you think? The very simple module clause seems to be quite standard practice, but isn't particularly important to document if someone object. I've also notified WT:WPT. --Trialpears (talk) 22:55, 18 April 2021 (UTC)Reply[reply]

Seems reasonable. The argument (used in the discussion in question, which I've appended to your link above) that having a template be a wrapper is some sort of kitten-killing server-waste is just nonsense, because with very small exception (also listed in said discussion) we just don't do it. It's never been written down because no one has ever really discussed the matter, but if there are concerns starting to arise we might as well codify current practices. Primefac (talk) 23:25, 18 April 2021 (UTC)Reply[reply]
I don't know if someone's mentioned it, but if a large amount of wikitext is involved, a wrapper template may be very costly as it doubles the include size which significantly slows down previews/saves of an edit, and might prevent the page working if the 2MB limit is hit. Johnuniq (talk) 23:47, 18 April 2021 (UTC)Reply[reply]
Right, such as the current uses for things like big sports tables, where the module is just as much for formatting as it is for data storage. I don't know if If a module is easily implementable in a template... is enough to convey that, but it does essentially give that sort of exemption. Primefac (talk) 23:57, 18 April 2021 (UTC)Reply[reply]
Whatever wording is accepted, there should definitely be an exemption for technical needs. – Jonesey95 (talk) 00:27, 19 April 2021 (UTC)Reply[reply]
In my suggested wording below I said that any "convoluted" template would be better as Lua which should be a suitable catch-all for technical difficulties etc – and obviously mere guidance can't tell you to do something technically impossible. User:GKFXtalk 11:14, 19 April 2021 (UTC)Reply[reply]
Thinking about this a bit, I have a couple of thoughts and questions: What is the argument for limiting the preference for template wrappers to those used in mainspace? If it's about the ease of use for editors, should we be concerned about that policy impacting the learning curve when it comes to editors starting to experiment with working on templates, categories, help, etc.?
If there is a legitimate reason to distinguish between namespaces, I would definitely suggest that talk pages would go with articles, so the second sentence would be "If a module is intended to be used in articles or talk pages, a template wrapper should generally..."
Also, the TfD that prompted this discussion seems to center on the converse of this proposal: should template wrappers for modules be limited to those useful for transcluding in mainspace, with a preference for deleting those wrappers when they are primarily used outside of articles? VanIsaac, MPLL contWpWS 00:32, 19 April 2021 (UTC)Reply[reply]
First off, it was not my intention to make a "server kittens" argument against templates. My point is more like this: if I see the code ((wrapper template|arg1|arg2...)) and I wonder what it means/why it's not working, I have to go to Template:Wrapper template and Module:Whatever to figure it out. If Module:Whatever had been used directly, I'd only have to look in one place.
As for the word ((#invoke:)) being scary or raising a learning curve, it's not much different in appearence to parserfunctions etc which are widely used in templates.
There seem to be two seperate pieces of guidance in Trialpears's suggestion above. I've split them giving my opinion below. To answer the TfD question, the second implies that wrapper templates not intended for use in mainspace have no use so would be deleted.
  • Straightforward templates are prefered to modules, and modules are prefered to convoluted templates. This means you should generally use Lua when you want one of its features like loops, arrays, or complex logic.
  • Avoid calling ((#invoke:)) in articles or their talk pages (except when discussing wikimarkup). Use a wrapper template in those cases; in template code call modules directly if possible.
User:GKFXtalk 07:04, 19 April 2021 (UTC)Reply[reply]
I've created a module section. It is based on the text suggested above but modified based on comments here. Shouldn't be anything too controversial in there but feel free to edit/remove/discuss. --Trialpears (talk) 23:12, 28 April 2021 (UTC)Reply[reply]

Shortcut T: for Template:  ?[edit]

Is it possible to have this, as we do with H: for Help: and others? Facts707 (talk) 08:57, 13 June 2021 (UTC)Reply[reply]

Facts707 we kind of do as can be seen at Category:Redirects to template namespace, but there are some problems with the practice in that they technically are in the article namespace meaning they show up in search results when they shouldn't. You can also not use them like you would expect for transcluding a template with a normal redirect in template space being better for that. --Trialpears (talk) 09:07, 13 June 2021 (UTC)Reply[reply]
In addition, the issue has been discussed in the past and consensus is that introducing more abbreviations would be confusing and undesirable. Use ((tl)) if appropriate, otherwise write "Template" if that is what is meant. Johnuniq (talk) 10:03, 13 June 2021 (UTC)Reply[reply]
This is just a side comment to John's post, but I don't understand why everyone insists on using ((tl)) when ((t)) is a character shorter and points to the same template. Also, this gets you essentially the same number of characters, as your hypothetical [[T:Example]] becomes ((t|Example)) (plus you don't need to worry about piping the "T"). Primefac (talk) 10:45, 13 June 2021 (UTC)Reply[reply]
These sort of redirects were effectively deprecated in in 2014 for the reasons that Trialpears has laid out. The problems could be resolved if the T: shortcuts got hard-coded into the wiki software (the way WP: and WT: are), but this seems unlikely to happen. – Uanfala (talk) 11:55, 13 June 2021 (UTC)Reply[reply]
There are a few redirects of this type. But T:MP is not a template, nor are T: The New York Times Style Magazine and t:kort. Except for the DYK related ones, there is very little reason to type them in and to ever use a shortcut. ((:T:ILL)) is longer than ((ill)), so why would you want a T: shortcut that makes you type more when you transclude it? —Kusma (talk) 12:03, 13 June 2021 (UTC)Reply[reply]
The benefit of such a shortcut would not be in transcluding templates or in referring to them in discussions like this one, but in edit summaries and search boxes. But because T:, unlike C: and D:, is already used widely for other purposes, that's not going to happen. -- Michael Bednarek (talk) 14:04, 13 June 2021 (UTC)Reply[reply]
Edit summaries are the best use case. Your C: and D: links go to Commons and Wikidata. —Kusma (talk) 14:42, 13 June 2021 (UTC)Reply[reply]
Using the searchbox when searching for the documentation of, say, ((Wikisourcelang-inline)), would also be simpler with T: . The point of showing those links (C:, D:) was indeed to demonstrate how some single-letter "shortcuts" have been implemented; M: and S: are others, but the train for T: has left the station. -- Michael Bednarek (talk) 03:13, 14 June 2021 (UTC)Reply[reply]

Article text-storing templates[edit]

The templates ((Rotten Tomatoes prose)) and ((MC film)) have been nominated for deletion for storing article text, per WP:TMPG. The discussion can be seen here: Wikipedia:Templates for discussion/Log/2022 March 23#Review aggregator prose templates. Erik (talk | contrib) (ping me) 22:45, 23 March 2022 (UTC)Reply[reply]

Guideline about storing text[edit]

WP:TMPG states at the beginning, "Templates should not normally be used to store article text, as this makes it more difficult to edit the content." A recently-closed TfD at Wikipedia:Templates for discussion/Log/2022 March 31#Review aggregator prose templates keeping such a template by default indicates that this guideline is no longer applicable. Templates storing article text are created in good faith, to centralize content, in spite of the presented difficulty in editing it. If there are no examples of templates being deleted under this guideline, then the guideline should not exist any longer. It can be left to the community to determine a consensus or lack thereof to use such templates on a case-by-case basis. Editors are welcome to comment about this point. Erik (talk | contrib) (ping me) 17:56, 16 April 2022 (UTC)Reply[reply]

No, it indicates that in one specific case enough people who are not regularly involved with templates moaned enough that the rule wasn't enforced. If you do a search for "article text" in TfD archives, then you can see that the rule is generally enforced. One discussion that goes against an established consensus does not nullify the future applicability of that consensus in other discussions. * Pppery * it has begun... 18:01, 16 April 2022 (UTC)Reply[reply]
These discussions are always limited to a handful of already-involved editors, and this particular template had extraordinarily high visibility. The lack of deletion validates this kind of template in spite of the guideline. The next article text-storing template (especially in regard to film and television) can point to the preceding one on the same grounds, and so forth. There's no reason to keep a law on the books, so to speak, if it is irrelevant in the face of large-scale use across popularly-trafficked articles. The guideline simply did not apply for an ideal example that warrants it in the first place. It's time to simply remove it and let templates' existence be determined by the community for each template. Erik (talk | contrib) (ping me) 18:15, 16 April 2022 (UTC)Reply[reply]
No it's not time to delete common-sense rules. A few exceptions for any rule can always be found. Further, "no consensus" is hardly a ringing endorsement and the text involved is short and a good argument for consistency can be made. Johnuniq (talk) 00:25, 17 April 2022 (UTC)Reply[reply]
The review aggregator prose templates and others like ((Year article header)) that I don't anticipate will be challenged anytime soon indicate that there's at least some level of support for prose templates in some circumstances where text format can be highly regularized. The current guideline acknowledges that with normally; I might weaken that slightly, but I don't see a huge issue. ((u|Sdkb))talk 05:37, 17 April 2022 (UTC)Reply[reply]
I'm saying that this outcome (which defaults to keep, which is the actual outcome) sets a precedent that ultimately contradicts the guideline. This is what will happen. This high-visibility template will appear on more and more film articles (which are some of the most highly trafficked on Wikipedia) because certain editors are obsessive with proliferating shiny new features. The above editor and others like them will come up with more kinds of article text-storing templates. I can see them being empowered to create such templates for CinemaScore, Box Office Mojo, etc. where any related TFD attempted will have WP:TPMG be irrelevant because the Rotten Tomatoes template already exists. Why would any of these be truly deleted (not kept, not "no consensus") if RT survived and continued to be used? When these templates became more and more prevalent, this part of the guideline will become more and more obsolete and unquotable. It didn't apply when it was most relevant. Erik (talk | contrib) (ping me) 14:10, 17 April 2022 (UTC)Reply[reply]

Template titles[edit]

This page states that Template function should be clear from the template name, but redirects can be created to assist everyday use of very popular templates. Is this still community consensus? I recently opened a RM at ((efn)), citing that sentence. The vibe I got from that discussion was that this may not be in line with current community consensus. Is this the case? Courtesy pings for everyone who participated in the discussion: @Jonesey95, Graham, Redrose64, BarrelProof, AlphaBeta135, and Uanfala: HouseBlastertalk 20:13, 26 February 2023 (UTC)Reply[reply]

Article tables?[edit]

Templates should not normally be used to store article text. However, article tables (especially with detailed data) seem to be a common use for templates. See, for example, Template:Low melting point alloys and Category:Materials science templates. I'd like to propose clarifying the template guidelines with respect to stand-alone tables, please. Either permitting this particular use or making it explicit they are also discouraged. Just like any other type of article content, it's still difficult to edit content segregated in templates. (BTW, couldn't this issue be ameliorated with a standard template header/footer with View, Edit, Talk links?). If the banning of templates for article tables is ratified, should this updated guideline be pro-actively enforced on all current cases (with nominations for deletion or merging)? fgnievinski (talk) 02:06, 22 April 2023 (UTC)Reply[reply]

Discussion at Template talk:Rotten Tomatoes prose § RfC: Should this and similar templates be substonly?[edit]

 You are invited to join the discussion at Template talk:Rotten Tomatoes prose § RfC: Should this and similar templates be substonly?. ((u|Sdkb))talk 20:59, 1 December 2023 (UTC)Reply[reply]