Wikipedia talk:WikiProject Templates
This is the talk page for discussing WikiProject Templates and anything related to its purposes and tasks. |
|
Archives: 1, 2, 3, 4, 5, 6, 7, 8, 9Auto-archiving period: 4 months ![]() |
![]() | This project page does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||
|
Feedback requested re Tfd links
editIf you are interested in WP:Templates for discussion, you may recall that each Tfd idiscussion has a small set of convenience links at the top, generated by {{Tfd links}} and the underlying module. An enhancement request is open to add a new convenience link, and your feedback would be appreciated at WT:Templates for discussion#Module:Tfd links edit request: add new link. Thank you. Mathglot (talk) 16:28, 25 March 2025 (UTC)
Looking to create Encyclopedia Source templates.
editWikipedia:WikiProject Fraternities and Sororities uses Baird's Manual of American College Fraternities *extensively*. It had 20 editions starting in 1879 with the last in 1977 with the last being over 600 pages. We'd like to create Encyclopedia Source templates looking like {{Bairds14|345-346}}
. At this point starting out, the templates would only have one argument starting out, page/pages. Are there suggestions on templates to use as a guide or any issue with this idea?Naraht (talk) 11:03, 8 April 2025 (UTC)
- Check out Category:Encyclopedia source templates for many examples. Instead of a numerical parameter (
{{Bairds14|345-346}}
), it would be more flexible to pass along the in-source parameters to a CS1 template ({{Bairds14|pp=345-346}}
). Your template could then use|p=
,|pp=
, and|at=
in the article. If the encyclopedia template uses Module:Template wrapper, then it will automatically support those parameters. {{cite Catholic Encyclopedia}} works this way. Rjjiii (talk) 11:33, 8 April 2025 (UTC) - @Naraht Hey, idk if this is the best place to mention this, but I checked Wikipedia talk:WikiProject Fraternities and Sororities and saw some of the discussion about which template to base yours on. There isn't going to be anything lost really choosing between {{cite encyclopedia}} and {{cite book}}. Cite book has a
|section=
parameter that works the same cite encycolpedia's|entry=
parameter. There is no difference in the output, just the parameter names and setup. You can also use {{citation}} with Module:Citation mode; I think it does have less useful metadata, but I don't remember exactly why. Feel free to {{ping}} me if you get stuck at any point. Rjjiii (talk) 01:36, 10 April 2025 (UTC)
Remove ifeq statement when substing a template
editI'm working on a template to expediate the expansion of a certain type of tables with location data, and I have an #ifeq statement that stays in source with the #ifeq statement. I need this to be where it is otherwise links to Georgia will be sent to a disambiguation page instead of Georgia (U.S. state). The #ifeq statement in the source doesn't affect where the source goes and is invisible to most readers, but unnecessarily inflates the page's source length, especially when this template is intended to save time when being reused tens or even hundreds of times on a single page. What should I do in this instance? The template is at User:Departure–/iemlisttemplate. Thanks! Departure– (talk) 17:29, 11 April 2025 (UTC)
- You can subst parser functions the same as other templates. See also Help:Safesubst. Izno (talk) 17:45, 11 April 2025 (UTC)
- I spent some time in the past building new templates and better ones, and I found that a large number of #ifeq functions could be replaced by one or more #switch functions. If you know how or learn how to construct switches, then you might find that they are better and faster than using many #ifeq functions. P.I. Ellsworth , ed. put'er there 23:00, 11 April 2025 (UTC)
- Even better, that huge block can be replaced by the already-existing {{USStateNameToAbb}}. Primefac (talk) 12:29, 12 April 2025 (UTC)
- Thanks to everyone here. I'm going to be experimenting with this type of template to save me time from now. Departure– (talk) 16:35, 13 April 2025 (UTC)
- Even better, that huge block can be replaced by the already-existing {{USStateNameToAbb}}. Primefac (talk) 12:29, 12 April 2025 (UTC)
Wikilink text colour output
editHi all, new to wikitext; coding experience is limited to the brain cells I lost writing broken MATLAB programs at uni. I'm looking at making the text output for the black|disqualified|dsq
parameter at Template:Motorsport result to be always white, including wikilinks. Any help would be greatly appreciated, gen-AI has been completely hopeless at pointing me in the right direction!
Outputs | |
---|---|
Current | Desired |
SPA FEA DSQ |
SPA FEA DSQ |
MB2437 21:14, 18 April 2025 (UTC)
- Yes, there is definitely a need to lighten the link color to aid accessibility. There is also a need to distinguish link text from non-link text even when the background color changes. Perhaps a lighter blue text?
Outputs Current Desired SPA
FEA
DSQSPA
FEA
DSQ
- I agree, but all-white text on black is the long-standing convention for WP:MOTORSPORT (we recently received suggestions to improve the accessibility of our colour palette, which were swiftly pushed away to avoid needing to alter 20,000+ articles). Just looking to simplify this for editors in the WP as entering a disqualified result currently requires at least some knowledge of wikimarkup to keep it all-white. MB2437 23:24, 18 April 2025 (UTC)
- Please see Help:Link color for information on coloring links. From what I can see, you basically have to put your
<span color:xxx>...</span>
inside the [[ ]] wikimarkup to be able to change link colors. VanIsaac, GHTV contrabout 23:42, 18 April 2025 (UTC)
Assistance needed
editHaving a problem with List of House members of the 45th Parliament of Canada, for which I need some help from someone with more skill in template coding than I've got.
The problem is that the members tables are zooming past the right margin of the display window, and thus covering the right-hand "tools" menu in a way that renders those links nearly impossible to use — basically you have to try to navigate a link into the whitespace between two tables in order to actually click on it — so I need somebody to look into whether there's any code in them that needs to be changed to confine them to the article display margins. Bearcat (talk) 21:41, 30 April 2025 (UTC)
- Someone has set minimum width values on the columns, such as
min-width:28em;
on many of the "Titles" columns. Since most of the "Titles" columns are empty, I would just remove that column's min-width and let the tables figure out an appropriate width. Also, you might want to hack your .css file to allow the content column (the part that is not the two sidebars) to take up more space in your browser window. Vector 2022's defaults are pretty lame in that regard. – Jonesey95 (talk) 15:10, 1 May 2025 (UTC)
Error message issued by Template:DGRG
editDear Colleagues,
I hope I have come to the correct place to report the following problem; if not, then I apologise.
I have just come across the subject template, and was hoping that someone with the appropriate coding skills would please fix the error message issued by default:
-
{{cite encyclopedia}}
: Empty citation (help): Missing or empty |title= (help)
Adding the 'title=' parameter ({{DGRG|title=Dictionary of Greek and Roman Geography}}
) fixes the error message but simply duplicates the book title in double quotation marks, which doesn't seem useful:
- This article incorporates text from a publication now in the public domain: Smith, William, ed. (1854–1857). "Dictionary of Greek and Roman Geography". Dictionary of Greek and Roman Geography. London: John Murray.
Very many thanks in advance.
With kind regards;
Patrick. ツ Pdebee.(talk)(become old-fashioned!) 15:30, 10 May 2025 (UTC)
- @Pdebee, what entry in the encyclopedia are you citing or crediting? The template is written so that it needs either
|wstitle=
for entries available on wikisource or|title=
. This seems intentional. There is a maintenance category for pages that don't specify an article in the encyclopedia at: Category:Wikipedia articles incorporating a citation from the DGRG with no article parameter. I can't think of a great alternative. For example, some templates will default to using the title of the Wikipedia article, but many of these entries won't match the Wikipedia entries. For example, DGRG has 3 entries for Athens all with a different spelling that a human editor would need to specify. Rjjiii (talk) 16:46, 10 May 2025 (UTC)
- Dear Rjjiii,
I was looking at Exilles and noticed that the{{SmithDGRG}}
template (which redirects to{{DGRG}}
) is used in the 'Sources' section. This prompted me to try and fix the red error message, hence the above alert when I realised I couldn't. Thank you for your cogent explanation above, which I only saw just now, as I was offline this weekend.
With kind regards;
Patrick. ツ Pdebee.(talk)(become old-fashioned!) 10:00, 12 May 2025 (UTC)
- Dear Rjjiii,
- Dear Hike395,
Thank you so much for fixing this error condition so promptly; your technical assistance is much appreciated!
With kind regards;
Patrick. ツ Pdebee.(talk)(become old-fashioned!) 10:00, 12 May 2025 (UTC)
- Dear Hike395,
Template doc not showing as anticipated
editHi all, I have created documentation for Template:British university, but it is not showing on the main page as it does in the separate documentation article (shortcut box and see also section missing). Is there any way I can fix this? MB2437 08:29, 16 May 2025 (UTC)
- I have fixed it with a purge of the template page. -- John of Reading (talk) 08:56, 16 May 2025 (UTC)
Standardization of template formats and measurements
editWhy do sidebar and series templates have different widths? Here are two examples:
Trump–Russia relations |
---|
Can this be fixed so they are all the same width?
I'm sure this is likely addressed elsewhere, so point me in the right direction... >>> -- Valjean (talk) (PING me) 01:52, 16 July 2025 (UTC)
- On desktop resolution these appear to be the same width to me. A look at the CSS matches that expectation. Izno (talk) 02:27, 16 July 2025 (UTC)
- I'm using Firefox, and they are definitely different, regardless of the zoom factor. To spare my old eyes, I usually use 120-133%. They are clearly different widths to me. -- Valjean (talk) (PING me) 04:51, 16 July 2025 (UTC)
- They are not, according to the CSS and my own experience (Win10, Firefox 140, Vector 2022), which doesn't vary on any of those dimensions. I can verify that in safe mode they are identical widths, so I suspect you have some gadget or anon that is causing the issue. You are welcome to upload a WP:SHOT I suppose, but I would guess no one will be able to help you. Izno (talk) 05:25, 16 July 2025 (UTC)
- I'm running Firefox 140.0.4 and have either the same or a similar mismatch in template widths. I am at default magnification (100%). There is something going on here. VanIsaac, GHTV contrabout 05:30, 16 July 2025 (UTC)
- They are both using Module:Sidebar. The default width is 22em. Both templates try for 22em, but the second one has an image that is specified as 250px, so (for me) the second template is rendered wider than 22em. – Jonesey95 (talk) 05:34, 16 July 2025 (UTC)
- That would explain a mismatch, but not why at least one person doesn't have a mismatch. :D Izno (talk) 05:35, 16 July 2025 (UTC)
- You lot are using Monobook. The font size on Monobook (and a few other older skins) will cause the 22em to be interpreted there as a smaller width than the image. Izno (talk) 05:37, 16 July 2025 (UTC)
- I'm using Vector 2022, FWIW, and I see the lower template wider than the upper one (about 264px versus 239px). – Jonesey95 (talk) 05:40, 16 July 2025 (UTC)
- Did you set your font size to Small in V22? That still doesn't affect the font size sufficiently for me. I get a Standard font width computed at about 310px for both and in Small I get a computed width of 271px.
- Y'all going to need to verify this issue exists for you in safe mode and review your preferences both onwiki and personal for font size adjustments. you may have made. Skins that aren't V22 are one way to have this issue (I experienced it in Monobook and Modern but neither Vector, choosing to use a non default skin is your choice but will likely have negative effects like this). Izno (talk) 06:21, 16 July 2025 (UTC)
- In safe mode, the top one is still narrower. It looks like I have the font size set to "Small", which was the old default. When set to "Standard" or "Large", the boxes are the same size (272px wide for me in Standard). When I am logged out, the top box is slightly smaller when the font size is set to "Small", and the boxes are the same width at the other font sizes. It still appears to me that the fixed 250px image size is causing the width difference. There are many reasons to avoid fixed px sizes for images; this appears to be one of them. – Jonesey95 (talk) 13:22, 16 July 2025 (UTC)
- No, it's clearly the image, but that doesn't explain why I have a roughly 10% larger font size by default than you do even in safe mode. Izno (talk) 20:59, 16 July 2025 (UTC)
- I am using Monobook. Whatever the case, it appears that the image is the problem. Can that be fixed? The boxes should be the same width for everyone, regardless of their systems or preferences. -- Valjean (talk) (PING me) 15:10, 16 July 2025 (UTC)
- We should not optimize for skins not used by, well, most of our readers. So no, I disagree with changing the image based on your experience. Izno (talk) 20:02, 16 July 2025 (UTC)
- In safe mode, the top one is still narrower. It looks like I have the font size set to "Small", which was the old default. When set to "Standard" or "Large", the boxes are the same size (272px wide for me in Standard). When I am logged out, the top box is slightly smaller when the font size is set to "Small", and the boxes are the same width at the other font sizes. It still appears to me that the fixed 250px image size is causing the width difference. There are many reasons to avoid fixed px sizes for images; this appears to be one of them. – Jonesey95 (talk) 13:22, 16 July 2025 (UTC)
- I'm using Vector 2022, FWIW, and I see the lower template wider than the upper one (about 264px versus 239px). – Jonesey95 (talk) 05:40, 16 July 2025 (UTC)
- They are both using Module:Sidebar. The default width is 22em. Both templates try for 22em, but the second one has an image that is specified as 250px, so (for me) the second template is rendered wider than 22em. – Jonesey95 (talk) 05:34, 16 July 2025 (UTC)
- I'm running Firefox 140.0.4 and have either the same or a similar mismatch in template widths. I am at default magnification (100%). There is something going on here. VanIsaac, GHTV contrabout 05:30, 16 July 2025 (UTC)
- They are not, according to the CSS and my own experience (Win10, Firefox 140, Vector 2022), which doesn't vary on any of those dimensions. I can verify that in safe mode they are identical widths, so I suspect you have some gadget or anon that is causing the issue. You are welcome to upload a WP:SHOT I suppose, but I would guess no one will be able to help you. Izno (talk) 05:25, 16 July 2025 (UTC)
- I'm using Firefox, and they are definitely different, regardless of the zoom factor. To spare my old eyes, I usually use 120-133%. They are clearly different widths to me. -- Valjean (talk) (PING me) 04:51, 16 July 2025 (UTC)