Template:For is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases.
This is the talk page for discussing improvements to the For template.
This template is within the scope of WikiProject Disambiguation, an attempt to structure and organize all disambiguation pages on Wikipedia. If you wish to help, you can edit the page attached to this talk page, or visit the project page, where you can join the project or contribute to the discussion.DisambiguationWikipedia:WikiProject DisambiguationTemplate:WikiProject DisambiguationDisambiguation
Text has been copied to or from this page; see the list below. The source pages now serve to provide attribution for the content in the destination pages and must not be deleted as long as the copies exist. For attribution and to access older versions of the copied text, please see the history links below.
Unlike other hatnote templates like {{See also}} and {{Details}}, this one doesn't have its own Lua module (see Module:Hatnote). One thing that Lua provides is dynamic link formatting for things like section and category links. Have a look at the following and you'll see the difference:
Ideally this template will eventually join its siblings in module-land. In the meantime, I would like to propose the following edit, using {{Format link}}, to make it behave more like the others:
{{Hatnote|For {{#if:{{{1|}}}|{{{1}}}|other uses}}, see {{format link|{{{2|{{PAGENAME}} (disambiguation)}}}}}{{#if:{{{3|}}}|{{#if:{{{4|}}}|, {{format link|{{{3}}}}}, {{#if:{{{5|}}}|{{format link|{{{4}}}}}, and {{format link|{{{5}}}}}|and {{format link|{{{4}}}}}}}| and {{format link|{{{3}}}}}}}}}.}}
Does that look correct? Anyone interested can test it using {{For/sandbox}}, with the same parameters as you would use with this template. Ibadibam (talk) 22:36, 24 September 2014 (UTC)[reply]
Edit request
This edit request has been answered. Set the |answered= parameter to no to reactivate your request.
While I like the idea behind the proposed edit, the implementation caused some unwanted results in hatnotes such as at Black Widow (song) where the hatnote is {{For|other songs by the same title|Black Widow (disambiguation)#Songs|Black Widow}} where the expectation is for it to be displayed as a piped link. older ≠ wiser15:38, 3 October 2014 (UTC)[reply]
I should be done soon. FYI, this template has 116000+ transclusions, so I'm being extra careful. Your change definitely looks right though. Tried Special:Permalinks, namespaces with links, etc, all looks good. — Andy W. (talk · contrib)00:53, 1 May 2016 (UTC)[reply]
I'm 99% sure you don't need colons in front of the parameters. I'm actually inclined to publish the current code at Template:For/sandbox (without colons in front), since Module:Hatnote's format link takes care of the colon issue. What was your reasoning about the colons? (in case I'm missing something here) — Andy W. (talk · contrib)01:10, 1 May 2016 (UTC)[reply]
That's just what {{for}} has right now - all I did (at least, all I think I did) was replace [[ with {{format link| and ]] with }}. There was no other particular reason. I don't really know what their effect is, so I decided to be careful and leave them in. Hairy Dude (talk) 01:20, 1 May 2016 (UTC)[reply]
Here's essentially a master testcase I did:
{{For/sandbox|other songs by the same title|Black_Widow_(disambiguation)#Songs|Special:Permalink/717941754#Tennis_at_the_2012_Summer Olympics|Category:Wikipedia semi-protected templates|User talk:Example user#what}}, with/without colons in front, spaces vs underscores. {{For/sandbox}} was essentially the same as your version, without a colon (which format link is able to take care of). Thanks! :) — Andy W. (talk · contrib)01:28, 1 May 2016 (UTC)[reply]
Colons are only necessary if the linked page name begins with either (i) File: or (ii) Category:. It's needed to prevent (i) display of the image; (ii) inclusion in that category. --Redrose64 (talk) 08:29, 1 May 2016 (UTC)[reply]
Support for section linking
This template seems not to change Article#Section into Article § Section as {{Further}} does. For instance, I was adding this hatnote:
{{for|a table of examples of palatalized n and l in Romance languages|Palatalization#Mouillé}}
For a table of examples of palatalized n and l in Romance languages, see Palatalization § Mouillé.
That seems to be breaking some WP:PDAB advice, as I don't think "Black Widow" rises to the notability standards suggested by "Thriller" and "Revolver".
Nonetheless, I suppose this template should be fixed to recognize when a link is piped, and only use Article § Section on non-piped links. Wbm1058 (talk) 19:25, 13 September 2015 (UTC)[reply]
"Not to be confused with" typos
I've occasionally seen the {{confused}} template used in the style of Google's "did you mean..." autocorrect, where one word is spelled very similarly to another. (Reality: "Not to be confused with Realty.") It seems a little perverse to present an easily-misread typo in a vague "don't confuse this with that" sentence where the reader may well misread it. Is it worth having a dedicated template for common typos? Or is "see also this similarly-spelled word" simply an inappropriate hatnote? --McGeddon (talk) 10:30, 15 July 2015 (UTC)[reply]
the last producing e.g. {{for|similar terms|Foobar|Bar|Baz|Quux}}.
However, if you really want that word, it would be correct to also exchange the example code with its demonstration, provided the two preceding demonstrations were also removed:
The third, fourth and fifth parameters are used to give two, three, or four supplementary links, {{for|similar terms|Foobar|Bar|Baz|Quux}} producing e.g. .
Is there any way to avoid the appearance of double periods at the end of a sentence? For instance, the page for Donald S. Lopez, Sr. uses the for template to point to Donald S. Lopez, Jr. (It looks like this: {{For|the Professor of Buddhism|Donald S. Lopez, Jr.}}). The period at the end of the junior appears right next to the sentence-ending period, and it looks awkward: For the Professor of Buddhism, see Donald S. Lopez, Jr.. <--- See the two periods at the end. Anything we can do about instances like this? Thanks 04:29, 4 February 2016 (UTC)
I'd second the need for this: A Theory of Justice requires a hatnote to A Theory of Justice: The Musical!, but this and other comparable templates all contain the period at the end, without giving an option to suppress it, as it currently comes up as punctuated (For the 2013 musical, see A Theory of Justice: The Musical!.). Is there the possibility of making it switchable for cases like these where the article title already ends in punctuation (e.g. |punc=no| to remove the period)? — Sasuke Sarutobi (talk) 10:02, 6 May 2016 (UTC)[reply]
That article says (using this template) "For the Negativland album, see Dispepsi." But Dispepsi doesn't sound anything like Indigestion: it really needs an extra sentence saying "Dyspepsia redirects here" to explain why the link is being offered. Can the template do this? Equinox◑20:22, 6 February 2017 (UTC)[reply]
I'd like to remove the defaulting to "other uses" when parameter 1 is empty or undefined. Instead, the template should show an error message instructing users to use {{other uses}} instead. While this might be mildly annoying to editors in each individual case, it avoids newbie-incomprehensible syntax like {{for|2=PAGE}} being left on pages where {{other uses|PAGE}} would be clearer, and an error message would be enough to instruct people to use the correct template.
Currently all offending cases are categorized in Category:Hatnote templates using unusual parameters; I've at various points corrected all the extant article-namespace cases, and there are none left as of this comment, but it collects them over time.
There are so many cases of this use of {{For}} that it seems unnecessarily disruptive to replace it with an error message for the sole purpose of calling attention to something invisible to the reader. Better to fix it through automation. Ibadibam (talk) 22:14, 25 June 2018 (UTC)[reply]
I agree that it is confusing. But among the alternatives, {{For|other uses}} seems marginally more intuitive than {{Other uses}}. – Uanfala (talk)14:38, 1 July 2018 (UTC)[reply]
I don't see significant objections here, and after waiting for the merge proposal to be resolved (it ended with no consensus), I'm picking this up again. I've set up the new behaviour in the module and template sandboxes, and you can currently see direct comparisons at Template:For/testcases. {{Nihiltres |talk |edits}}19:58, 14 July 2018 (UTC)[reply]
@Nihiltres: Sorry for not pointing this out earlier, but I would oppose explicitly blocking "other uses" as simply unnecessary (this does not mean I oppose removing the defaulting). {{3x|p}}ery (talk) 21:04, 20 July 2018 (UTC)[reply]
Would you suggest an alternative? I'm trying to balance clarity with concision. I'll write up a longer explanation of the error in the template documentation, as the target of the help link, on implementation. {{Nihiltres |talk |edits}}15:40, 22 July 2018 (UTC)[reply]
"No parameters" would be incorrect, as it'll occur with{{for||second parameters|and further}}. I'm going to be bold and implement it; we can fine-tune the error message later as needed. {{Nihiltres |talk |edits}}16:07, 16 August 2018 (UTC)[reply]
Template-protected edit request on 31 October 2020
This edit request to Module:For has been answered. Set the |answered= parameter to no to reactivate your request.
Allow multiple targets with multiple descriptions?
I think it would be helpful to allow multiple alternate targets with multiple descriptions, just as Template:About does. I had to switch templates here in Marsaglia, as it was not possible to stay with "for", but this makes the hatnote longer for no reason, and certainly not better. --KnightMove (talk) 06:59, 26 January 2021 (UTC)[reply]
How do you envisage this would work, KnightMove? The way the template has been set up, it will chain all positional parameters after the first one into a list of targets, without descriptions:
In this version, there is a redlink in hatnote that does not cause an error. Nihiltres, another one to keep in mind if you are able to find a good way to catch these this as in the others. MB15:31, 3 December 2021 (UTC)[reply]
I've been looking at the problem. The best solution will be to put the error-checking in Module:Hatnote, specifically its link-formatting functionality. That would let all hatnote templates naturally inherit the functionality, so that I don't have to implement the same feature a dozen times. The catch is that the functionality is reused in {{format link}}, so I'd probably want to introduce a way to disable the error-checking. Additionally, checking for the existence of other pages is notionally an expensive operation, so it risks causing downstream errors … but it's probably worth it.
I've been busy the past couple of weeks, so I haven't been able to apply much effort to the problem, but I expect that I can sandbox a solution sometime in the next few days and then apply it once a) tested and b) I've left a chance for others to comment on the change. {{Nihiltres |talk |edits}}16:50, 3 December 2021 (UTC)[reply]
Template-protected edit request on 6 December 2022
Hey there, I am here not to make any changes or edits to this template, but to actually see the code for this template. I work on a fandom wiki and we are having an issue where with our "For" template, we can only get a max of 2 fields. For example, if it have [For|other uses|xxx|xxx|xxx] it will only insert For other uses, see xxx and xxx. I wanted to see the code for it but it wouldn't allow me, so I created this account five minutes ago just so I could talk on here. In case you're wondering, I work on the Call of Duty Wiki.
Thanks, FearMePhoenix (talk) 17:23, 6 December 2022 (UTC)[reply]
For hatnotes, I believe it would be helpful to include (transclude?) instructions on the appropriate hatnote template pages for how to italicize (unitalicize, really) what would normally be so according to the Manual of Style. I remembered seeing it long ago and recently had to go to random articles (making educated guesses) hoping to see an example of it so I could copy it. Only after I figured it out did I come across WP:ITHAT just now. I'm sure I've added many a hatnote without proper italics. — TARDIS builder✉ • 11:24, 29 May 2024 (UTC)[reply]
@Andrybak – Oh yes, that's very helpful. Now, to include that on all the hatnote templates! I wouldn't even know how to find the full list. [cry laughing emoji seems appropriate here] — TARDIS builder✉ • 15:50, 29 May 2024 (UTC)[reply]
Is there any reason not to use this template in a section other than the lead? For example, in the Phonology section of the Quebec French article at [[2]], I think the sentence under the "main article" hatnote should also be a hatnote, and I'd use this template for it if that isn't prohibited. Largoplazo (talk) 13:32, 1 September 2025 (UTC)[reply]
I'm not sure I follow. Are you saying you want to replace {{main|Quebec French phonology}} with use of {{For}} conveying the same thing? Or do you want to link to something else? If the former, is there a reason you'd want to change {{Main}} to {{For}}? older ≠ wiser13:47, 1 September 2025 (UTC)[reply]