Template talk:For

Link formatting
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:

Which would give us...

Does that look correct? Anyone interested can test it using, with the same parameters as you would use with this template. Ibadibam (talk) 22:36, 24 September 2014 (UTC)

Edit request
Per above and. Ibadibam (talk) 23:30, 29 September 2014 (UTC)
 * ✅. Thank you &mdash; Martin (MSGJ · talk) 08:23, 1 October 2014 (UTC)
 * 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 where the expectation is for it to be displayed as a piped link. older ≠ wiser 15:38, 3 October 2014 (UTC)
 * It's the same problem that appears when using the template . I left a note about that for, now archived at User talk:Edokter/Archive 8. -- Red rose64 (talk) 16:41, 3 October 2014 (UTC)
 * The pipe hack seems to work there (for now), but I have no thoughts about how this should be handled in the future.  17:50, 3 October 2014 (UTC)

Second edit request
I tested this edit in my user space (User:Hairy_Dude/For, test case at User:Hairy_Dude/sandbox for the time being) and format link appears to handle the specific problem identified above correctly now, so I'd like to see the template use it again. Hairy Dude (talk) 00:14, 1 May 2016 (UTC)
 * I currently see:
 * For: "For other songs by the same title, see Black Widow (disambiguation)#Songs and Black Widow."
 * Your output: "For other songs by the same title, see Black Widow (disambiguation) § Songs and Black Widow."
 * Looks correct. Give me a sec to check a few more things... &mdash; Andy W. (talk &middot; contrib)  00:35, 1 May 2016 (UTC)
 * 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. &mdash; Andy W. (talk &middot; contrib)  00:53, 1 May 2016 (UTC)


 * Checked Template:For and its sandbox for changes.
 * Checked Template:Format link and its sandbox for changes.
 * Checked code updates at Module:Hatnote.

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) &mdash; Andy W. (talk · contrib)  01:10, 1 May 2016 (UTC)
 * That's just what for has right now - all I did (at least, all I think I did) was replace  with   and ]]|undefined 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)
 * Here's essentially a master testcase I did:
 * , 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! :) &mdash; Andy W. (talk &middot; contrib)  01:28, 1 May 2016 (UTC)
 * Yes check.svg Done &mdash; Andy W. (talk &middot; contrib)  01:28, 1 May 2016 (UTC)
 * Thanks for your work! Hairy Dude (talk) 01:52, 1 May 2016 (UTC)
 * 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. -- Red rose64 (talk) 08:29, 1 May 2016 (UTC)

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: So I had to use For2: Is this intentional, or could it be remedied? — Eru·tuon 08:39, 3 January 2015 (UTC)

Oh, I see it was already mentioned. So a change was made fixing this problem, but then reverted? — Eru·tuon 08:46, 3 January 2015 (UTC)


 * I was coming to ask the same thing. Is this intentional?--Cúchullain t/ c 16:56, 3 June 2015 (UTC)
 * The rationale for reverting this seems to be that section-liking broke piped links, such as here.
 * Curiously enough, I find that Black Widow (song) isn't linked from Black Widow.
 * 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)

"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)

Unreadable
This documentation is unreadable. Can it please give an example of how to code two possible alternatives? Prhartcom (talk) 00:09, 23 September 2015 (UTC)
 * I . It's a start. -- Red rose64 (talk) 09:15, 23 September 2015 (UTC)
 * That helps. Still doesn't start at the beginning. Made another improvement. Prhartcom (talk) 02:14, 24 September 2015 (UTC)
 * I amended it; in particular, I reverted your change of "being produced by" to "producing", since it is incorrect to state

The third, fourth and fifth parameters are used to give two, three, or four supplementary links:

the last producing e.g..
 * 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, producing e.g..


 * since "[code] produces [demo]" is equivalent to "[demo] being produced by [code]". -- Red rose64 (talk) 10:06, 24 September 2015 (UTC)

Double periods?
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: ). 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)

This looks strange at Indigestion
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)
 * I think what you're looking for is the template redirect. — Eru·tuon 00:26, 7 February 2017 (UTC)


 * Yep! I've changed it now. Equinox ◑ 18:07, 9 February 2017 (UTC)

Removing "other uses" defaulting
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 being left on pages where  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.

Does anyone have any objections to this change? {&#123; Nihiltres  &#124;talk &#124;edits}&#125; 16:59, 19 June 2018 (UTC)
 * Seems like a good idea to me, assuming my proposal to merge the two templates fails. &#123;&#123;3x&#124;p&#125;&#125;ery (talk) 17:13, 25 June 2018 (UTC)
 * There are so many cases of this use of 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)
 * No, that's incorrect. I wrote Module:For, and a while back set it up to categorize pages with that usage in Category:Hatnote templates using unusual parameters, and as of this comment there are zero article-namespace pages (and fewer than fifty total pages) in that category, which currently only collects that case (the others have been resolved). {&#123; Nihiltres &#8202;&#124;talk&#8202;&#124;edits}&#125; 02:02, 26 June 2018 (UTC)
 * Oh great. Ibadibam (talk) 22:27, 26 June 2018 (UTC)


 * I agree that it is confusing. But among the alternatives,  seems marginally more intuitive than  . – Uanfala (talk) 14:38, 1 July 2018 (UTC)
 * There's always the for other uses redirect… {&#123; Nihiltres  &#124;talk &#124;edits}&#125; 17:50, 2 July 2018 (UTC)

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. {&#123; Nihiltres  &#124;talk &#124;edits}&#125; 19:58, 14 July 2018 (UTC)
 * 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). &#123;&#123;3x&#124;p&#125;&#125;ery (talk) 21:04, 20 July 2018 (UTC)
 * That's fair, I suppose. I'd prefer to include it as uses of the exact-match case should probably be using other uses instead strictly for semantic clarity, but as for would still be reasonably correct usage for individual cases of "other X" it's probably OK to leave. As a compromise, why don't we leave the exact-match cases to populate Category:Hatnote templates using unusual parameters? {&#123; Nihiltres &#8202;&#124;talk&#8202;&#124;edits}&#125; 19:05, 21 July 2018 (UTC)
 * Well, fine with me I guess . &#123;&#123;3x&#124;p&#125;&#125;ery (talk) 19:17, 21 July 2018 (UTC)
 * I've updated the sandbox to match the compromise. Look good now? {&#123; Nihiltres &#8202;&#124;talk&#8202;&#124;edits}&#125; 19:43, 21 July 2018 (UTC)
 * yes, except for the fact that the error message "no context parameter provided." is unclear. &#123;&#123;3x&#124;p&#125;&#125;ery (talk) 22:38, 21 July 2018 (UTC)
 * 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. {&#123; Nihiltres &#8202;&#124;talk&#8202;&#124;edits}&#125; 15:40, 22 July 2018 (UTC)
 * Just "no parameters specified"?. &#123;&#123;3x&#124;p&#125;&#125;ery (talk) 14:28, 23 July 2018 (UTC)

"No parameters" would be incorrect, as it'll occur with. I'm going to be bold and implement it; we can fine-tune the error message later as needed. {&#123; Nihiltres  &#124;talk &#124;edits}&#125; 16:07, 16 August 2018 (UTC)

Template-protected edit request on 31 October 2020
Please apply Special:Diff/963584211/986365894 to suppress categorization of talk pages and user pages into Category:Hatnote templates using unusual parameters. This is similar to what Module:Hatnote does since Special:Diff/967664662. —⁠andrybak (talk) 11:51, 31 October 2020 (UTC)
 * ✅: Special:Diff/986771546. —⁠andrybak (talk) 22:34, 2 November 2020 (UTC)

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)
 * How do you envisage this would work, ? 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:
 * outputs:
 * When using About, you don't need to make the hatnote longer: you can omit the string "This article is about X" by supplying an empty first parameter . – Uanfala (talk) 20:38, 30 January 2021 (UTC)
 * Ok, that's a good practical solution, thank you. But writing my explanation how it could work, I've just found out that Template:For2 does exactly what I want. --KnightMove (talk) 21:15, 30 January 2021 (UTC)
 * Ok, that's a good practical solution, thank you. But writing my explanation how it could work, I've just found out that Template:For2 does exactly what I want. --KnightMove (talk) 21:15, 30 January 2021 (UTC)

Adding Template:For2 here in "See also"
and all others: Do you agree on adding Template:For2 in the "See also" section, so users who need that template get to know about it? --KnightMove (talk) 06:17, 31 January 2021 (UTC)
 * Sorry, I've just realized how to do it myself on the unprotected documentation page (edit). So in the end, this topic is really done. --KnightMove (talk) 06:47, 31 January 2021 (UTC)

✅ --KnightMove (talk) 06:47, 31 January 2021 (UTC)

Sent to TfD
I have sent this template to TfD for a merge with Template:For2. See Templates for discussion. Please add the TfD notice:

 

to the top of the template. Thanks. 18:53, 30 June 2021 (UTC)
 * Yes check.svg Done firefly  ( t · c ) 19:56, 30 June 2021 (UTC)

Error checking
In this version, there is a redlink in hatnote that does not cause an error. , another one to keep in mind if you are able to find a good way to catch these this as in the others. MB 15:31, 3 December 2021 (UTC)


 * 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. {&#123; Nihiltres  &#124;talk &#124;edits}&#125; 16:50, 3 December 2021 (UTC)

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)
 * This template calls a Lua module, Module:For, which should be visible to anyone with or without a registered user account. – Jonesey95 (talk) 17:26, 6 December 2022 (UTC)

Documentation on italics in hatnote
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 &#9993;    •       11:24, 29 May 2024 (UTC)


 * TARDIS Builder, please see new section in the documentation: Template:For/doc. Is something like this what you had in mind? —⁠andrybak (talk) 15:34, 29 May 2024 (UTC)
 * @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 &#9993;     •       15:50, 29 May 2024 (UTC)
 * Do you mean Category:Hatnote templates? This could be tricky due to different layouts of the /doc pages, however, the best way would be to create a shared documentation template. Documentation pages of some of the hatnote templates already use a shared content template – the navbox Hatnote templates. For "Styling in italics", something like Template:Hatnote italics doc could be created with the content from Special:Diff/1226267598. —⁠andrybak (talk) 18:36, 29 May 2024 (UTC)
 * @Andrybak – Sounds good, but way out of my depth. Where would it be appropriate for me to make this request / suggestion?  — TARDIS builder &#9993;     •       05:43, 30 May 2024 (UTC)
 * In case I did not ping you correctly last time.  — TARDIS builder &#9993;     &#9733;       21:11, 31 May 2024 (UTC)
 * TARDIS Builder, you could try asking at Requested templates. —⁠andrybak (talk) 21:13, 31 May 2024 (UTC)