Template talk:For

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Link formatting[edit]

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:

Markup Renders as
{{see also|PAGE#SECTION}}

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}}}}}}}}}.}}

Which would give us...

Markup Renders as

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)

Edit request[edit]

Per above and this example. Ibadibam (talk) 23:30, 29 September 2014 (UTC)

 Done. Thank you — 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 {{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. olderwiser 15:38, 3 October 2014 (UTC)
It's the same problem that appears when using the {{redirect}} template here. I left a note about that for Edokter (talk · contribs), now archived at User talk:Edokter/Archive 8#Monk (Doctor Who). --Redrose64 (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. -- [[User:Edokter]] {{talk}} 17:50, 3 October 2014 (UTC)

Second edit request[edit]

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... — Andy W. (talk · 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. — Andy W. (talk · contrib) 00:53, 1 May 2016 (UTC)

──────────────────────────────────────────────────────────────────────────────────────────────────── @Hairy Dude:

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)

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)
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)
Yes check.svg Done — Andy W. (talk · 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. --Redrose64 (talk) 08:29, 1 May 2016 (UTC)

Support for section linking[edit]

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é}}

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[edit]

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)


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)

@Prhartcom: I did this. It's a start. --Redrose64 (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. {{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. .

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

Double periods?[edit]

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)

This looks strange at Indigestion[edit]

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)

@Equinox: 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)