Template talk:Plain link
This template was considered for deletion on 2020 June 10. The result of the discussion was "Withdrawn". |
Template:Plain link 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 protected}} to notify an administrator 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. |
Examples
edit{{plainlink|url=http://www.goo.com}}
{{plainlink|url=http://www.goo.com|.uk}}
[.uk]
{{plainlink|http://www.goo.com goo}}
Edit protected
edit{{editprotected}}
Please replace the content with the following, so that people using it without specifying the 'name' parameter will have it working again, thanks.
<includeonly><span class="plainlinks">[{{{1|{{{url|{{{URL|}}}}}}}}} {{{2|{{{NAME|}}}}}}]</span></includeonly><noinclude>
{{pp-template|small=yes}}
{{template doc}}
</noinclude>
— neuro(talk)(review) 10:26, 17 April 2009 (UTC)
- Done, thanks. I basically copied the code from {{plainlinks}} to also allow "name", and retain the old priority should someone have managed to give both "URL" and "url". :)
Cheers, Amalthea 11:27, 17 April 2009 (UTC)
Ugly space at the end
edit{{Plain link}} seems to be causing an unwanted space at {{clarify-section}} (between "article" and the full stop) and probably other message boxes. Is this fixable? It's pretty unpleasant aesthetically. – hysteria18 (talk) 01:06, 2 April 2012 (UTC)
- {{Plain link}} wasn't being used correctly, I've fixed it. ··gracefool☺ 07:45, 19 June 2012 (UTC)
Shortcut parameters
editThis edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please replace the content with the following (copied from the Sandbox where you can see it working), so that "u" and "n" can be used as shortcuts for the "url" and "name" parameters:
<span class="plainlinks">[{{{1|{{{u|{{{URL|{{{url}}}}}}}}}}}} {{{2|{{{n|{{{NAME|{{{name|}}}}}}}}}}}}]</span><noinclude>
{{documentation}}
</noinclude>
··gracefool☺ 07:50, 19 June 2012 (UTC)
- Why is this needed? There are already 3 different names for these parameters. If name is too much to type, you can just use the unnamed parameter. — Martin (MSGJ · talk) 11:45, 19 June 2012 (UTC)
- Because if the URL has an = in it, you have to use named parameters. Unnamed parameters would be preferable, this is a workaround. It's a lot more readable with minimal names. ··gracefool☺ 19:24, 19 June 2012 (UTC)
- If the URL has = in it, you can use the syntax
{{Plain link|1= |2= }}
. Or you can type 3 extra characters. I would generally oppose adding so many alternative parameter names to a template because it complicates the code and confuses people. — Martin (MSGJ · talk) 19:33, 19 June 2012 (UTC)- Oh woops of course, I forgot about the default numbered parameters... thanks. I've added a note to the documentation. ··gracefool☺ 20:49, 19 June 2012 (UTC)
- If the URL has = in it, you can use the syntax
- Because if the URL has an = in it, you have to use named parameters. Unnamed parameters would be preferable, this is a workaround. It's a lot more readable with minimal names. ··gracefool☺ 19:24, 19 June 2012 (UTC)
Added "Don't use http: or https:" to the doc.
editI wrote in the doc that you shouldn't begin the URL with http: nor https:. --Ahora (talk) 12:07, 23 October 2012 (UTC)
Make it more robust
editThis edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please apply this diff, which allows this template to handle the new tough testcase. Petr Matas 19:49, 19 November 2014 (UTC)
- Not done: please establish a consensus for this alteration before using the
{{edit protected}}
template. Why is this necessary?{{replace}}
is expensive. Using it twice, nested, needs some strong justification. --Redrose64 (talk) 21:28, 19 November 2014 (UTC)
- I needed it on Wikidata in d:Template:Query, which uses the brackets heavily, and I thought it would be beneficial to port it here as well. Petr Matas 02:21, 20 November 2014 (UTC)
Proposal to remove extraneous space after link
editThis template appears to insert an extraneous space after the link when used in templates like {{Linksearch}} and {{Underused external link template}}. Here is Plainlink in parentheses, showing that it does not insert a space on its own:
But here is a {{Linksearch}} template used in parentheses, showing a space before the closing parenthesis:
- This is (the live Linksearch template) in parentheses.
And here is {{Underused external link template}} (note the space after "check here"):
This external link template is underused, compared to the number of links to the site it represents (check here). Please help convert those links to make use of this template, for ease of tracking, and ease of interoperability with Wikidata. |
I have adjusted the code in Plainlink/sandbox to test for the second parameter, adding a space only if it is found. I don't know why this fixes the downstream templates. Here is Plainlink/sandbox in parentheses, showing that it still works:
Here is a Linksearch/sandbox template used in parentheses:
- This is (the sandbox Linksearch template) in parentheses.
And here is {{Underused external link template}} using the sandbox version:
This external link template is underused, compared to the number of links to the site it represents (check here). Please help convert those links to make use of this template, for ease of tracking, and ease of interoperability with Wikidata. |
If someone has a better explanation or fix, I'm all ears. – Jonesey95 (talk) 03:06, 20 October 2016 (UTC)
- Except for the last pipe, that's the way that I'd have done it myself, so Done --Redrose64 (talk) 10:05, 20 October 2016 (UTC)
- @Redrose64 and Jonesey95: This change, or something related to it, seems to have broken templates further up the chain - the {{copyvios}} template is now omitting the word "Copyvios" from the link title and instead appending it to the URL (eg. link instead of Copyvio link). --McGeddon (talk) 12:25, 20 October 2016 (UTC)
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Flagging this as an edit request to revert, as this is a "heavily used and/or highly visible template" and Redrose64 hasn't edited for a couple of hours so may be offline. An unexplained extraneous space seems preferable to link URLs being mangled in some cases, for now. --McGeddon (talk) 12:42, 20 October 2016 (UTC)
- Undone: This request has been undone. — Martin (MSGJ · talk) 12:55, 20 October 2016 (UTC)
- I don't know why Jonesey's fix did not work, but the code currently in Template:Plain link/sandbox seems to do the job — Martin (MSGJ · talk) 13:14, 20 October 2016 (UTC)
- Don't break any templates on my account. I was off-line and was unable to see the malformed links, but my sandbox experiments were doing the same thing to me in the {{Linksearch/sandbox}} template (adding the first word of the link text to the URL), which was why I tracked the (potential) fix back to this template. – Jonesey95 (talk) 17:51, 20 October 2016 (UTC)
- I've deployed again. Hopefully no issues this time! — Martin (MSGJ · talk) 07:55, 21 October 2016 (UTC)
- Don't break any templates on my account. I was off-line and was unable to see the malformed links, but my sandbox experiments were doing the same thing to me in the {{Linksearch/sandbox}} template (adding the first word of the link text to the URL), which was why I tracked the (potential) fix back to this template. – Jonesey95 (talk) 17:51, 20 October 2016 (UTC)
- I don't know why Jonesey's fix did not work, but the code currently in Template:Plain link/sandbox seems to do the job — Martin (MSGJ · talk) 13:14, 20 October 2016 (UTC)
Difference between {{plain}} and {{plain link}}
editWhat is the difference between {{plain}} and {{plain link}}? {{plain}} appears to be a slightly less complicated version of {{plain link}}. What’s the point of that?
―PapíDimmi (talk | contribs) 18:52, 10 May 2017 (UTC)
- PapiDimmi, I don't see any difference. I'll nominate them for merging and see how it goes. {{u|Sdkb}} talk 01:43, 10 June 2020 (UTC)
Template-protected edit request on 29 August 2017
editThis edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Could someone please wrap the if statement at the top in {{{|safesubst:}}}
, so that this template can be cleanly substituted. It is currenly substituted by the {{falsepositive}} template, which causes an unnecessary if statement in the wikimarkup of every report to WP:EFFP. Pppery 15:13, 29 August 2017 (UTC)
- Done — JJMC89 (T·C) 18:25, 29 August 2017 (UTC)
Parameter 2 seems to have stopped working
editSomething broke this template:
{{plain link|url=//www.google.com|foo}}
- [foo]
{{plain link|url=//www.google.com foo}}
- foo
— SMcCandlish ☏ ¢ 😼 08:35, 21 June 2018 (UTC)
- The template is not smart enough to use one named parameter and one unnamed parameter. If you're going to use
|url=
, you have to use|name=
or|2=
. - We would need more if statements to allow what is attempted above. This is one of the many reasons templates should not allow multiple unnamed parameters. – Jonesey95 (talk) 12:59, 21 June 2018 (UTC)
You are invited to join the discussion at Wikipedia:Templates for discussion/Log/2020 June 10#Template:Plain. {{u|Sdkb}} talk 01:48, 10 June 2020 (UTC)
Maintenance category
editThe template instructions note that this template is "not suitable for genuinely external links". Is there a maintenance category to monitor places where the template is being used in contrary to this rule? —Ost (talk) 21:39, 11 October 2021 (UTC)
Making plurals and verb-tense forms work
editIs there any way this template can be modified so any trailing plural forms or or verb tense forms of the word outside the braces will appear as part as the word in the same way it does for regular internal bracketed links do?
As an example, here is making an external plain link using the word ‘Castle’ with the plural form ‘s’ immediately after the braces:
…which does not make the plural form at the end (i.e. the ‘s’) display as part of the link.
Whereas a standard internal ‘bracketed’ link using the word ‘Castle’ with the plural form ‘s’ immediately after the brackets does:
Hopefully there is a way to make this work.