Jump to content

Wikipedia talk:WikiProject Templates

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

discussion

[edit]

here. 77qq 💬 contributions 02:21, 16 December 2025 (UTC)[reply]

Alt text templates at TfD

[edit]

 You are invited to join the discussion at Wikipedia:Templates for discussion/Log/2026 January 9 § Template:Alternative text missing, which is within the scope of this WikiProject. Rosaecetalkcontribs 10:06, 10 January 2026 (UTC)[reply]

Combining templates

[edit]

Not super smart on templates, but is it possible to combine {{Should be PNG}} and {{PNG version available}} into a single template? I am imagining something like {{PNG image}} with a parameter to change the type to either of the two current templates and also add the appropriate category to mark the content. This would also open the possibility for future types to be created as needed instead of creating even more templates. Evan.oltmanns (talk) 19:19, 25 January 2026 (UTC)[reply]

I'm not sure it would make sense to combine them, given they're giving two rather distinct messages. Primefac (talk) 19:26, 25 January 2026 (UTC)[reply]
The idea would be to use #switch in order to handle the appropriate output text, category, and formatting as needed. Evan.oltmanns (talk) 00:29, 26 January 2026 (UTC)[reply]
I can see the logic in desire for a single template for low-quality images both before and after they have PNG alternates, but the function in those two instances is so divergent, I would hesitate to make a template with the double function. The proposed name is also problematic as it suggests that the tagged file is a PNG, rather than it needs or points to a PNG alternative, but that's a much more transient concern. The inexorable problem I am envisioning is that you either have to have an explicit flag to choose between the two behaviors, or you set it based on a parameter value for the alternate PNG version filename being provided. If you use the explicit flag, you run into the issue that not providing that filename presents an ambiguity - was the flag parameter set in error, or is there a mystery PNG version out there that we don't know where it's located? On the other hand, filename parameter-based functionality precludes tracking categories for files that ostensibly have a PNG version available, but the filename isn't provided. It is a fundamental drawback to combining these two templates that cannot be overcome: you lose either functionality or introduce ambiguity to your maintenance tracking. Templates need to be designed on the basis of fixing imperfect usage, not on the assumption of perfect rollout. VanIsaac, GHTV contrabout 01:18, 26 January 2026 (UTC)[reply]
If there were an argument here for a merge, it would be {{should be PNG}} and {{should be SVG}} as {{should be file type|SVG}}, but even those are pretty different. Izno (talk) 02:56, 26 January 2026 (UTC)[reply]

Suggestion: add a simple beginner example

[edit]

Hi! I am a new contributor learning templates.

I noticed that the page is very detailed, but beginners might benefit from a very small, simple example early on (for example showing

This is an example of a template. For help with templates, see Help:Template.

usage with a short explanation).

If this sounds reasonable, I would be happy to help draft the text here. Thank you! Stitipragyan barik (talk) 18:10, 4 February 2026 (UTC)[reply]

Hi, which page(s) are/were you looking at for help? We have (for better or worse) a ton of pages related to templates, including WP:Templates and Help:Template, so what you're looking to create might already exist (just want to make sure of that before time and effort is spent). Primefac (talk) 11:11, 10 February 2026 (UTC)[reply]
Somewhat related discussion from a couple years ago: Help talk:Introduction#Why is there no "template" sub-topic?. —⁠andrybak (talk) 04:01, 11 February 2026 (UTC)[reply]

Help with a WP banner template image

[edit]

I recently fixed up a couple Templates using File:Barnstar search rescue.png, but I'm having trouble with the last one, Template:WikiProject_Article_Rescue_Squadron. Nothing I do seems to make the image appear properly. It currently includes:

|IMAGE_LEFT          = Barnstar search rescue.png
|IMAGE_LEFT_SIZE     = 70px

This seems like it should work. I tried adding "File:" to the IMAGE_LEFT parameter and removing the IMAGE_LEFT_SIZE parameter. Neither made the image show up in the preview. What am I doing wrong? TIA! WidgetKid converse 15:40, 19 February 2026 (UTC)[reply]

It looks fine to me. What doesn't look right to you? — Martin (MSGJ · talk) 16:11, 19 February 2026 (UTC)[reply]
@MSGJ, it now appears to be working fine. ¯\_(ツ)_/¯ Maybe I just needed to clear my browser cache or something. Thanks anyway! WidgetKid Converse 19:24, 1 March 2026 (UTC)[reply]

I made a suggestion on adding another site to it in mid-January, got decently positive feedback with a request to do more research, and then I got busy for awhile before I could finish that research. I finished a week ago, and my reading of the consensus is that it should be added, but neither of the other editors in the thread have responded, and given that I do not have much experience with templates, I do not want to make the change myself without further feedback, so I am wondering if someone else could look over the situation and see if they agree it should be added and that my code is not broken. 1brianm7 (talk) 19:18, 1 March 2026 (UTC)[reply]

Performers in festival navboxes

[edit]

Any input at Template talk:Woodstock#Performers would be appreciated. --woodensuperman 11:36, 10 March 2026 (UTC)[reply]

Your feedback requested at Talk header Rfc

[edit]

There is currently an Rfc being held to discuss the appearance of the {{Talk header}} template. Your feedback at Template talk:Talk header would be appreciated. Thanks, Mathglot (talk) 02:17, 31 March 2026 (UTC)[reply]

 You are invited to join the discussion at Template talk:Interlanguage link § calling WikiData and other wikimedia projects. CapnZapp (talk) 21:31, 5 April 2026 (UTC)[reply]

Where to put styles.css of a template's sandbox?

[edit]

There are two conventions that are in conflict when trying to decide where to put styles.css page of a template's sandbox:

  1. Every sandbox of page Template:Foo is located at Template:Foo/sandbox
  2. Every TemplateStyles page styles.css for a page Template:Foo is located at Template:Foo/styles.css

This means that if Template:Foo is styled with Template:Foo/styles.css, then styles.css of its sandbox Template:Foo/sandbox has two potential locations:

  1. Following the first convention: sandbox of Template:Foo/styles.css is at Template:Foo/styles.css/sandbox
  2. Following the second convention: styles.css of Template:Foo/sandbox is at Template:Foo/sandbox/styles.css

Which of the two options is preferable? —⁠andrybak (talk) 14:50, 18 April 2026 (UTC)[reply]

Notified: Template talk:Uses TemplateStyles, Wikipedia talk:TemplateStyles, Wikipedia:Village pump (technical). —⁠andrybak (talk) 14:57, 18 April 2026 (UTC)[reply]
According to Wikipedia:TemplateStyles, In general, this means that a style page should be a subpage of the related template, so the second convention is appropriate. If we're seeing a lot of this out in the wild, we should probably make sure everything is standardised. Primefac (talk) 14:56, 18 April 2026 (UTC)[reply]
I've been a bit confused about this myself. I think the issue here stems from a difference of interpretation of what the two copies of "styles.css" are for. There are two interpretations:
  1. The "styles.css" used by the template sandbox isn't for the live template at Template:Foo, but rather for a distinct copy of the template at Template:Foo/sandbox. Each of these two templates has its own "styles.css".
  2. The second copy of "styles.css" is a sandbox copy of the live version of "styles.css", not a copy of "styles.css" for use by the template at Template:Foo/sandbox. Both the live and sandbox templates should use the same "styles.css" unless testing changes to the stylesheet, with the sandbox of "styles.css" at styles.css/sandbox being used to test changes to "styles.css" rather than direct changes to the template.
If you follow the first interpretation of the purpose of the second copy of "styles.css", then logically following the first convention, that every sandbox page is located at the title of the page followed by /sandbox, agrees with using Template:Foo/sandbox/styles.css for the "styles.css" used by the sandbox copy of the template, since the second copy isn't itself a sandbox, it's just the stylesheet for the sandbox.
If you follow the second interpretation, then logically following the first convention agrees instead with using Template:Foo/styles.css/sandbox.
I think we should adopt and enforce interpretation 2, since there's no reason for Template:Foo/sandbox to have its own separate "styles.css" unless you're testing changes to to "styles.css", and the sandbox copy is logically where you would use to observe these tests. The convention then, would be that the sandbox copy of a page always consistently ends with /sandbox, regardless of whether the page is a template, a stylesheet, a module, etc. and to use the live version you would simply omit /sandbox. (Edit: I now support adopting and enforcing the /sandbox/styles.css convention, for the technical reasons highlighted below.)
Regardless of what we decide, Wikipedia:TemplateStyles § Naming convention should be updated to clearly and explicit state what editors should do. – Scyrme (talk) 15:36, 18 April 2026 (UTC)[reply]
I've always followed the second convention, because my mental model is that everything that is experimental should go into the sandbox subarticle. — hike395 (talk) 15:43, 18 April 2026 (UTC)[reply]
That's fair, but it runs up against the issue of how to interpret which page is the "parent" of its "child" subpages. Is it Template:Foo or Template:Foo/styles.css? I don't think there's a "right" answer here, but to me the latter seems much more straightforward if you think about the case where a template has another template as a subpage (Template:Foo/Bar) instead of a stylesheet as a subpage. Simply appending /sandbox is what would automatically happen if you clicked the "create" link in the documentation box of a subtemplate, for example if you were to create a sandbox for {{GHS Reference/cs1}}, which is a subpage of {{GHS Reference}}. – Scyrme (talk) 16:23, 18 April 2026 (UTC)[reply]
Another thing to consider is if we want all stylesheets to always end with .css. If that's desirable, perhaps the convention should be that we use /sandbox for the template's sandbox, and /sandbox.css for the sandbox of "styles.css"? This could also make it clearer that the second copy of the stylesheet is for testing changes to the stylesheet. – Scyrme (talk) 15:47, 18 April 2026 (UTC)[reply]
There are currently 39 [1] pages with styles.css/sandbox. Around 34 of them were created at sandbox/styles.css but moved by Gonnym. There are 97 [2] with sandbox/styles.css. Sampling didn't find any which had been moved so without Gonnym it would be around 5 versus 131. I also support sandbox/styles.css. It's expected that CSS pages end in .css, also by MediaWiki. If it's created at styles.css/sandbox then an administrator is required to change the content type to Sanitized CSS like in [3]. This is impractical and likely to confuse many editors. PrimeHunter (talk) 16:19, 18 April 2026 (UTC)[reply]
Could adopting the use of /sandbox.css for stylesheet sandboxes work (as I suggested earlier)? Or would that also cause problems? – Scyrme (talk) 16:29, 18 April 2026 (UTC)[reply]
/sandbox.css would be created as Sanitized CSS and avoid the mentioned issue but I still prefer sandbox/styles.css. Template:Foo/styles.css/sandbox.css looks odd to me and editors are used to Template:Foo/sandbox/styles.css. PrimeHunter (talk) 16:47, 18 April 2026 (UTC)[reply]
To clarify, I was suggesting just using Template:Foo/sandbox.css not Template:Foo/styles.css/sandbox.css. ie. We'd be changing the guideline away from always using "styles.css", so that sandbox versions of the stylesheet are instead called "sandbox.css", and only live stylesheets are called "styles.css". Is there a technical reason why the stylesheet must be at a directory which includes "styles.css"? Or has doing so just been a convention? – Scyrme (talk) 17:02, 18 April 2026 (UTC)[reply]
TemplateStyles pages should normally be created at a ".css" title in the Template or Module namespace, to avoid having to have an administrator have to fix the content model. Even though WMF has recently changed things to allow people to create a page with a non-default content model using Special:ChangeContentModel, it's still likely that editors would create the page first, then realize it was wrong, and then have to have an admin fix it. Anomie 17:23, 18 April 2026 (UTC)[reply]
but moved by Gonnym Sadly, this does not surprise me. Anomie 17:23, 18 April 2026 (UTC)[reply]
Module namespace also has styles.css pages. When module namespace is included, first search gains 4: 39 → 43, second search gains 33: 97 → 130. —⁠andrybak (talk) 18:48, 18 April 2026 (UTC)[reply]
Looking at these examples I noticed another reason for consistently using /sandbox/styles.css, namely that {{Uses TemplateStyles}} expects and only detects the existence of a sandbox stylesheet if it's located at /sandbox/styles.css, but not if it's located at /styles.css/sandbox. If the stylesheet is located at the latter, no "(sandbox)" link is displayed.
We should probably move all the existing examples using /styles.css/sandbox to fix navigation. – Scyrme (talk) 19:31, 18 April 2026 (UTC)[reply]
Just for reference regarding {{Uses TemplateStyles}} expects and only detects the existence of a sandbox stylesheet if it's located at /sandbox/styles.css, but not if it's located at /styles.css/sandbox – this iteration of the logic in the underlying module was implemented in Special:Diff/861001237 per discussion at Wikipedia talk:TemplateStyles/Archive 1#Sandbox naming convention. —⁠andrybak (talk) 19:41, 18 April 2026 (UTC)[reply]
@Andrybak: Thank you for digging that out! I knew that it had been discussed before, I didn't think to go back almost eight years. RexxS (talk · contribs) raised some good points there. --Redrose64 🌹 (talk) 21:04, 18 April 2026 (UTC)[reply]
Template:Foo/sandbox/styles.css makes most sense to me. It's virtually certain that any real sandbox testing of the styles is going to also require use of Template:Foo/sandbox, if only to change the <templatestyles /> to point to the sandbox version, and in relation to that Template:Foo/sandbox/styles.css is more logical. Template:Foo/styles.css/sandbox lacks the ".css" extension, which is likely to cause problems and only makes sense if you're somehow trying to test changes to the styles in isolation from any changes to the parent template. Template:Foo/styles.css/sandbox.css just seems strange, and Template:Foo/sandbox.css requires editors to make assumptions as to what exactly it's the sandbox of. Anomie 17:23, 18 April 2026 (UTC)[reply]
I'm with Anomie's last paragraph entirely. --Redrose64 🌹 (talk) 17:48, 18 April 2026 (UTC)[reply]
No assumption needs to be made regarding Template:Foo/sandbox.css, as any /sandbox.css page would always been the sandbox version of the matching /styles.css page. So Template:Foo/sandbox.css is the sandbox for Template:Foo/styles.css, Template:Foo/Bar/sandbox.css is the sandbox for Template:Foo/Bar/styles.css etc. – Scyrme (talk) 18:07, 18 April 2026 (UTC)[reply]
Thinking about it more, I suppose the problem with sandbox.css is that a ".css" page doesn't necessarily have to be a stylesheet so there's nothing about that convention that implies it pairs with a styles.css page.
I now support the /sandbox/styles.css convention. – Scyrme (talk) 18:53, 18 April 2026 (UTC)[reply]
as any /sandbox.css page would always been the sandbox version of the matching /styles.css page Yes, that's the assumption that has to be made. If some template, for whatever reason, isn't following the /styles.css convention, then what? Anomie 18:59, 18 April 2026 (UTC)[reply]
I agree with Anomie that to test changes to a stylesheet, you need an accompanying sandbox template to make use of it. In cases where you're only testing changes to the template, you don't have to create a styles.css subpage; the sandbox page can continue to refer to the production styles.css page. I think it's more intuitive to keep sandbox versions of all supporting files (which could include stylesheets, utility templates, other templates within the same family, and so forth) with the same names and relative positions to the production template, just shifted below the sandbox subpage. isaacl (talk) 18:51, 18 April 2026 (UTC)[reply]
Agree with Issacl about test versions of all supporting files should be in /sandbox. The guideline should state this. — hike395 (talk) 19:01, 18 April 2026 (UTC)[reply]
Honestly kind of puzzling to be having this discussion, as it was settled in 2018. Izno (talk) 19:52, 18 April 2026 (UTC)[reply]
It was started because of the moves mentioned above by PrimeHunter. In November 2025, I tried clarifying it with Gonnym, but I wasn't convincing enough. The moves continued with the edit summary That's a local consensus for a single template that breaks every single other thing on this site: Special:Diff/1348614100, Special:Diff/1348614300.
I'd like to get a wider and clearer consensus to choose one of the conventions and discourage alternatives. —⁠andrybak (talk) 20:34, 18 April 2026 (UTC)[reply]
Why would it be puzzling? Not everyone knows that discussion occurred, it's not prominently linked to anywhere, and the guidelines were not amended to clarify the convention after that discussion so that confusion would continue doesn't surprise me. – Scyrme (talk) 21:03, 18 April 2026 (UTC)[reply]
It's the kind of thing that a cursory review of a talk page and its very short archive might have uncovered. And not all rules need to be written; I would have expected the convention to be clear. Obviously not.... Izno (talk) 21:46, 18 April 2026 (UTC)[reply]

Proposal to reword guidelines

[edit]

I propose we amend Wikipedia:TemplateStyles § Naming convention as follows:

Naming convention
  • Style pages must be clearly associated with their templates or modules and named accordingly (e.g. Template:Blockquote uses Template:Blockquote/styles.css).
  • The naming convention is to save the stylesheet for an associated page, template or module in a subpage of said page called /styles.css. This ensures the page automatically has the correct content model (sanitized-css) and can be easily identified as a style page.
  • Style pages should be associated with a specific template/module or group of templates/modules, and named accordingly. This allows style pages to be easily identified and edited. In general, this means that a style page should be a subpage of the related template. e.g. Template:myTemplate/styles.css or Template:myTemplate/styles-foo.css, but not Template:styles-foo.css nor Template:foo.css.
  • A sandbox for a template or module's style page should be associated with its sandbox page by appending /styles.css to the /sandbox page. e.g. Template:myTemplate/sandbox/styles.css, but not Template:myTemplate/styles.css/sandbox.

This would clarify the reasons for the conventions used and where the style page should be located. Thoughts? Feedback? – Scyrme (talk) 19:19, 18 April 2026 (UTC)[reply]