Jump to content

Template talk:Plain link

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
(Redirected from Template talk:Plainlink)

Examples

[edit]
{{plainlink|url=http://www.goo.com}}

[1]

{{plainlink|url=http://www.goo.com|.uk}}

[.uk]

{{plainlink|http://www.goo.com goo}}

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)[reply]

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)[reply]

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)[reply]

{{Plain link}} wasn't being used correctly, I've fixed it. ··gracefool 07:45, 19 June 2012 (UTC)[reply]

Shortcut parameters

[edit]

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)[reply]

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)[reply]
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)[reply]
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)[reply]
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)[reply]

Added "Don't use http: or https:" to the doc.

[edit]

I wrote in the doc that you shouldn't begin the URL with http: nor https:. --Ahora (talk) 12:07, 23 October 2012 (UTC)[reply]

Make it more robust

[edit]

Please apply this diff, which allows this template to handle the new tough testcase. Petr Matas 19:49, 19 November 2014 (UTC)[reply]

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

This 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:

(Wikipedia)

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

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:

(Wikipedia)

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:

If someone has a better explanation or fix, I'm all ears. – Jonesey95 (talk) 03:06, 20 October 2016 (UTC)[reply]

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)[reply]
@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)[reply]

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)[reply]

Undone: This request has been undone. — Martin (MSGJ · talk) 12:55, 20 October 2016 (UTC)[reply]
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)[reply]
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)[reply]
I've deployed again. Hopefully no issues this time! — Martin (MSGJ · talk) 07:55, 21 October 2016 (UTC)[reply]

Difference between {{plain}} and {{plain link}}

[edit]

What 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)[reply]

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)[reply]

Template-protected edit request on 29 August 2017

[edit]

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)[reply]

Done — JJMC89(T·C) 18:25, 29 August 2017 (UTC)[reply]

Parameter 2 seems to have stopped working

[edit]

Something 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)[reply]

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=.
  • {{plain link|url=//www.google.com|name=foo}}
  • foo
  • {{plain link|//www.google.com|foo}}
  • foo
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)[reply]

 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)[reply]

Maintenance category

[edit]

The 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)[reply]

Making plurals and verb-tense forms work

[edit]

Is 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:

Castles

…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:

Castles

Hopefully there is a way to make this work.

Lestatdelc (talk) 08:37, 18 February 2022 (UTC)[reply]