Template talk:projectlink

=Documentation=

Synopsis
This template is used for linking to pages on our sister projects (Wikipedia, Wikisource, and so on).

For example, this Wiki code:

produces this output:


 * [[Image:Wikipedia-logo.png|15px]] The Greek Wikipedia has an article on “Μβαρ”.

is a shortcut to  .

Parameters
This template's parameters are as follows:


 * 1) required The sister project, most commonly   (for Wikipedia) or   (for Wikispecies). There are also a few special values, such as   (for Wikipedia disambiguation pages) and   (for Wikipedia category pages). For a full list of possibilities, see Special:Prefixindex/Template:PL: (where the part after the   in a template-name is a possible value here; struck-through template-names indicate redirects).
 * 2) The name of the page on the sister project; defaults to the name of the current Wiktionary entry, but with an initial capital if applicable.
 * 3) The text that should be displayed on the link; defaults to the name of the page on the sister project.
 * : The language-code for the sister project; defaults to.
 * : The script-template that the link text should be wrapped in, if any. Otherwise it is bold.

=Discussion=

Sidebar link
Should the sidebar link produce a capitalized article title, for consistency with the in-body link? —Ruakh TALK 08:49, 21 November 2007 (UTC)


 * Yes, probably. It isn't using quite the same code, and probably should (use ucfirst: if the display is {1} or {PAGENAME}, not if the display is {2} (parameters to the PL template, these are {2} and {3} respectively to {projectlink}); this requires carefully editing the individual PL templates; I'll do that but not right now (-) Robert Ullmann 09:47, 21 November 2007 (UTC)

Wikipedia default
Is the fact that  defaults to   being used at all? Because I think that parameter should simply be made fully mandatory, rather than the current quasi-mandatory sometimes-work,-sometimes-not we have now. It's not like logically an editor should expect a template called "projectlink" to link to Wikipedia, anyway. —Ruakh TALK 08:49, 21 November 2007 (UTC)


 * I was emulating the existing function in {projectlinks}, but I agree. The existing calls need to be looked at; we just got an XML dump so that isn't too hard, even if there are too many to just use what-links-here. Robert Ullmann 09:47, 21 November 2007 (UTC)


 * There were three (-). Fixed. Removed the default from the template. Robert Ullmann 11:53, 21 November 2007 (UTC)


 * Thanks! :-) —Ruakh TALK 20:33, 21 November 2007 (UTC)

Centralizing code.
Currently, there's a lot of duplicate code among the various  templates. Specifically, I believe that all the code is the same for determining the link target and the link text, except of course for the project prefix in the link target, and the application of . It seems that rather than simply passing through  and  as <tt>1=</tt> and <tt>2=</tt>, it would make sense for this template to handle all the details itself. The only annoying thing is that it will somehow need to indicate to the sub-template whether the <tt>2=</tt> was an explicit <tt></tt> or a computed one, since the sub-templates that use <tt></tt> won't want to force-capitalize an explicitly-provided value. I think the simplest way is for this template to compute both a <tt>2=</tt> and a <tt>uc2=</tt>, and different sub-templates can choose which they want. It's a bit of pointless overhead, but I think the maintenance benefits will be worth it. (Another benefit is that we can then incorporate the handling of <tt></tt> into this template, so sub-templates won't need to worry about it at all.)

So, should I go ahead with that change?

—Ruakh <i >TALK</i > 02:25, 13 April 2008 (UTC)

function "Projectlinks" use on other skins.
Hello, i was wondering if the function on "Projectlinks" works on other skins. I'd like to use it, but my wiki doesn't use Vector or Monobook. Thank you, and i apologize if this is in the wrong place. Bud0011 07:29, 16 December 2010 (UTC).

Optional italics
Could this be fitted with an optional "i" parameter so that italics could be specified for the taxonomic names that are supposed to appear in italics? The kinds of names are all virus names and all taxonomic names at the rank of genus and below. Special (manual for now) provision needs to be made for names that include "subsp.", "var.", "morph"/"morpha", "subg.", and similar.

The same need applies to, /, , , , , and.

I could try to do this myself, but my template foo is weak, the template architecture is more complicated than I understand, and the templates are widely transcluded. I am doing this for various "reference" templates used for taxon names, which are both simpler in architecture and less widely transcluded. DCDuring TALK 17:56, 27 January 2015 (UTC)
 * Thanks, . DCDuring TALK 17:49, 18 October 2016 (UTC)

Make sidebar link match
This has annoyed me for a while. formats the sidebar links with the language code in superscript, like this Wikipedia: he, rather than he.Wikipedia. I think we should change this template to match because the first format is better looking and more clear. I propose replacing lines 27-35 at Template:projectlink/Wikipedia (which is protected) with: — Enosh (talk) 10:16, 11 May 2016 (UTC)
 * ✅ thanks to Codecat and the Luacisation of project link templates. —Enosh (talk) 14:08, 21 October 2016 (UTC)

End point
The end point in the of the template makes it unusable in the middle of a sentence. --DominiqueM (talk) 12:34, 26 January 2019 (UTC)

Capitalizing
The default for 1911 needs to be uppercase, because sequin links to the lowercase. Dunderdool (talk) 18:35, 9 July 2022 (UTC)


 * I checked and no Wikisource subpage of 1911 Encyclopædia Britannica begins with a lowercase letter, except for one exception that we probably won't need to link to. Therefore, it seems like making initial-uppercase the default wouldn't break anything. 98.170.164.88 18:41, 9 July 2022 (UTC)
 * Also, we can probably cut the Gordian knot entirely but not linking to EB. WP started kicking their asses years ago! Dunderdool (talk) 19:27, 10 July 2022 (UTC)