Jump to content

Template talk:URL/Archive 1

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Archive 1Archive 2

Proposed changes

I made a fork of this little-used template (no remaining instances in article space), {{Urlw}}. The differences are:

  • {{Url}} - input/ display / link = www.example.com / http://www.example.com/ / http://www.example.com/
  • {{Urlw}} - input/ display / link = example.com / example.com / http://www.example.com

For example:

Would anyone object to merging the two templates, using the latter's code; or making the "www." part switchable. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 11:05, 4 June 2010 (UTC)

It's probably possible to make the suppression of the "www" automatic using {{str left}}. Also, it appears as though {{link}}, is similar to this template, with the only difference being that the "stem" is not a separate field? Category: External link templates is very big and it would be good to merge some of these. We could repurpose this template to do the following:
Code Result Sandbox
{{url|example.com}} example.com example.com
{{url|www.example.com}} example.com www.example.com
{{url|http://www.example.com}} example.com www.example.com
{{url|https://www.example.com}} example.com www.example.com
{{url|www.example.com/foo}} example.com/foo www.example.com/foo
{{url|http://www.example.com/foo|link}} link link
{{url|www.example.com/foo|link}} link link
I may be forgetting a case. This should all be possible using some switching based on {{str left}} and #titleparts. I can code something up. What do you think? Plastikspork ―Œ(talk) 15:09, 7 June 2010 (UTC)
There is now some working sandbox code, with the output in the table above. Plastikspork ―Œ(talk) 22:11, 7 June 2010 (UTC)
That's absolutely superb, thank you! And backwards-compatible, too. I suggest we implement that ASAP, given the template's current low usage; and redirect {{Urlw}} and {{link}} here. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 10:13, 8 June 2010 (UTC)
Done. You could probably redirect {{urlw}}, since it was recently created. However, {{link}} has been around for awhile, has over 5000 transclusions, and slightly different functionality (i.e., when the first parameter is empty). This should be discussed a bit first, in my opinion, to make sure nothing breaks. Plastikspork ―Œ(talk) 05:13, 10 June 2010 (UTC)
{{Urlw}}/ {{Www}} redirected to this one. {{Url||foobar}} produces foobarwhile {{Link||foobar}} produces foobar, so I've raised that issue at {{link}}'s talk page, with a pointer to the section below. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 18:15, 10 June 2010 (UTC)

It is proposed to redirect {{Link}} to {{Url}}, which has additional functionality. However, {{Url||foobar}} produces "foobar", while {{Link||foobar}} produces "foobar". Are there any instances of the latter use? Is it needed? Would it be better if {{Url||foobar}} produced a prominent error warning? Are there any other issues which need to be addressed? Please discuss here. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 18:21, 10 June 2010 (UTC)

Requested move

The following discussion is an archived discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. No further edits should be made to this section.

The result of the move request was: Move. Jafeluv (talk) 11:09, 3 August 2010 (UTC)


Template:UrlTemplate:URL — "URL" is an acronym for "Uniform Resource Locator", so it would make more sense if this template name would be in all caps. There are many other templates in all caps such as {{ISSN}} and {{BCI}}, so I don't think having the template name here in all caps would be a problem. This move also wouldn't affect any articles that use lowercase {{url}} as url would just be a redirect to URL. エムエックスさん 03:28, 27 July 2010 (UTC)

The above discussion is preserved as an archive of a requested move. Please do not modify it. Subsequent comments should be made in a new section on this talk page. No further edits should be made to this section.

Broken 2010-10-20

The template is broken right now and needs repair. Sorry, I have no idea how to begin. Pirround (talk) 17:57, 20 October 2010 (UTC)

Found the issue at {{Str right}} and fixed with this. -- WOSlinker (talk) 17:59, 20 October 2010 (UTC)
Excellent. You had it fixed before I posted my notice. :-) Pirround (talk) 18:02, 20 October 2010 (UTC)

Problem report: 1964thetribute.com

I spotted this problem over at 1964 the Tribute: It's infobox is coded with {{URL|1964thetribute.com}} which looks like a correct usage to me. Nevertheless, it currently generates 1964thetribute.com which can't be right. Could someone with the necessary knowledge please look into this? Thank you. – IbLeo(talk) 05:20, 21 October 2010 (UTC)

I changed it to use {{URL|http://1964thetribute.com}} until someone has some time (and desire) to fix it. Unfortunately, this template is not the most robust. Plastikspork ―Œ(talk) 06:30, 21 October 2010 (UTC)
Thanks for the workaround. Sad that such a highly used template has such simple issues. – IbLeo(talk) 12:01, 21 October 2010 (UTC)
The problem is the fragile nature of the underlying parser functions used to make it work. I could write paragraphs on this issue, but basically the problem is with "#titleparts" and "#padleft" not always acting as expected. We are trying to make a template with no formal string parser functions, just these two. Plastikspork ―Œ(talk) 14:34, 21 October 2010 (UTC)
Honestly, I understand only very vaguely what you say – but I believe you :-) Cheers and good luck! – IbLeo(talk) 17:23, 21 October 2010 (UTC)
Okay, I found the problem. The current code implicitly requires that the URL starts with an alphabetical character. I could explain why, but it would take a bit of time. Basically, the check to see if the parser functions will fail depends on this. I believe this can be fixed by prepending an alphabetical character to this check. If it works, I will make the change in a second. Thanks! Plastikspork ―Œ(talk) 20:11, 24 October 2010 (UTC)

URL path display issues

Here are a few issues I am seeing with this today:

Code Dynamic Result Static Result
{{URL|http://example.com/}} example.com example.com/
{{URL|example.com/}} example.com example.com
{{URL|http://www.example.com/}} www.example.com example.com
{{URL|www.example.com/}} www.example.com example.com
{{URL|http://example.com/path/}} example.com/path/ example.com/path//path/
{{URL|example.com/path/}} example.com/path/ example.com/path/
{{URL|http://www.example.com/path/}} www.example.com/path/ example.com/path/
{{URL|www.example.com/path/}} www.example.com/path/ example.com/path/

Dynamic Result will change when the template is changed. Static Result is what I am seeing now at the time of this writing.

It seems to me this template should always work correctly when a full URL is provided and may work in other cases (e.g., when no URL scheme is provided, etc.). Currently it appears the display of the URL path is not being handled correctly. Removing any trailing slash in the display is probably a good thing but anything past that should probably left alone (with the display of the URL path element). 192.102.209.29 (talk) 22:33, 29 November 2010 (UTC)

Are you asking for the trailing slash to be removed in all cases? This should be possible, but it will add yet another layer of complexity to the code. By the way, you can always override the display result by specifying it explicitly. Plastikspork ―Œ(talk) 05:38, 1 December 2010 (UTC)
In part, yes I am. Methinks the bigger issue is the case where the path is appended twice to displayed value. I am aware the display can be overridden but then there is little reason to not just use wiki external link syntax directly then. 192.102.209.29 (talk) 20:46, 6 December 2010 (UTC)
I agree. I am just hesitating a bit about adding more complexity to this template, which is already fairly complex. I could do it, but I would need a bigger push. Thanks! Plastikspork ―Œ(talk) 22:55, 11 December 2010 (UTC)
{{URL|http://stargate.mgm.com/view/series/3/}} results in stargate.mgm.com/view/series/3//view/series/3/. (The path is duplicated when http:// is prefixed.) That surely warrants a fix. EdokterTalk 19:12, 20 December 2010 (UTC)
Yes, that's odd. I will see if I can sort it out. Plastikspork ―Œ(talk) 02:30, 21 December 2010 (UTC)
Okay, I found some time to check this out and the bug is now fixed. Plastikspork ―Œ(talk) 02:25, 22 December 2010 (UTC)

Bug

It's been pointed out that {{URL|http://stargate.mgm.com/view/series/3/}} renders as:

[Subst: of template redacted]

where the last three parts are repeated. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 10:58, 21 December 2010 (UTC)

This is now fixed (stargate.mgm.com/view/series/3/). Thanks for the bug report. Plastikspork ―Œ(talk) 02:24, 22 December 2010 (UTC)
Thank you. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 12:19, 28 December 2010 (UTC)

Optional display text

Unresolved

Somebody added an "optional display text" parameter. The purpose of this template is to display URLs, not hide them, especially in templates which emit microformats. The use of non-URL display text in this template will render such microformats invalid. I propose we revert those edits. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 22:49, 16 December 2010 (UTC)

If I recall, this parameter was there from the start for backward compatibility with other templates, and for cases which could not be handled by this template (very long URLs). Perhaps as a first step, we should get some idea of the context in which the second parameter is being used, then make a decision about removing it or not. If I recall, some infoboxes are using the second parameter explicitly. I have some opinions on why this template should not be used within infobox code, but that is an entirely different matter. Plastikspork ―Œ(talk) 19:26, 19 December 2010 (UTC)
You may be right about the timing; but the use of the parameter is causing incorrect metadata to be emitted (and in any case renders the template redundant). Where I say "in templates which emit microformats", I mean where this template is used - as intended - as part of a parameter value. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 21:38, 19 December 2010 (UTC)
Maybe the first step is to sort out its usage within templates, like {{Infobox television}}, then look toward removing the second parameter. The current usage of this template with {{Infobox television}} is entirely overkill, since the string parsing features are not being used at all. I know you are aware of that one, as you are actively commenting, but thought I would point it out the "overkill" nature. Plastikspork ―Œ(talk) 22:12, 19 December 2010 (UTC)
Okay, I made a minor non-functional change to {{Infobox television}} to reduce the overhead of calling this template, since the second parameter was always being used. I kept the url class by moving it to the infobox itself. I may eventually add a tracking category to this one to get an idea of where else it is being called with the second parameter. But, I would like to try to check the uses within template first to cut down on the number that would pop up in the category. I personally don't have a strong opinion on the formating, so long as it doesn't cause too much overhead. Plastikspork ―Œ(talk) 22:25, 19 December 2010 (UTC)
Thank you; I've replied there, but that's a separate issue. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 10:04, 20 December 2010 (UTC)

I'm still seeing instances in the form: {{URL|www.example.com/|official website}}. Perhaps we could add a caution not to do this to the documentation? Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 20:29, 4 April 2011 (UTC)

Printable version

It looks like this template is being used to format the URL at the bottom of the infobox in Alabama. If you check the printable version, you will see it displays as alabama.gov (http://www.alabama.gov), which is somewhat redundant. Worse is if you have WP generate a PDF version of the page. It then displays as [www.alabama.gov www.alabama.gov] and the link goes to http://www.alabama.govwww.alabama.gov. I was thinking we might be able to fix this in this template by removing part of this in print. The best would probably be to just display the bare URL in the printable version, and remove the redundant www.alabama.gov in the PDF version. Is this feasible? Thanks! Plastikspork ―Œ(talk) 01:25, 6 April 2011 (UTC)

What should be displayed? I don't think excluding {{URL}} from print is a great solution, but it can be tweaked for printing assuming we're not making things worse for other uses. If we agree on what should be displayed in all cases of Template:URL#Examples, then a tweak could perhaps be made. Another solution is to tweak {{Infobox U.S. state}}. And yet another is to simply tweak the articles themselves. Headbomb {talk / contribs / physics / books} 02:17, 6 April 2011 (UTC)
I agree. I was hoping that we could just tweak this template to make it display something more sensible in print. Do we have the same issue if I just use [http://www.alabama.gov alabama.gov] directly? If so, then perhaps the modification needs to be made in the engine that generates the PDF. I believe the printable version is doing something sensible here, but we could help it by telling it which parts were redundant, if that's possible. Thanks! Plastikspork ―Œ(talk) 02:23, 6 April 2011 (UTC)

Problem: Question marks in URL

I have found that if a question mark appears as part of the URL, then this is not working correctly. The example that shows this is http://www.bartow.k12.ga.us/education/components/scrapbook/default.php?sectionid=21 in the infobox in Woodland High School (Cartersville, Georgia). When the question mark is part of the first parameter, the second parameter is not functioning correctly either.

As an FYI, the documentation for {{Infobox school}} has recently been updated to encourage usage of this {{URL}} template, so it would be great to have this function "more robustly". Thanks! --Arg342 (talk) 11:22, 25 July 2011 (UTC)

Never mind. I see that the problem is the equals sign! So I have to use the 1= explicitly. --Arg342 (talk) 23:31, 23 August 2011 (UTC)

Exclusion of prefix is technically and in some cases practically wrong

See also Talk:Kingston_upon_Hull#.22www.22..

example http://st-marys.hull.sch.uk vs. http://www.st-marys.hull.sch.uk shows that the two are not the same.

Basically the www. prefix should not be removed as in some cases the two urls "www.foo.com" and "foo.com" are different.Imgaril (talk) 22:44, 25 August 2011 (UTC)

I fully agree.
In dozens of articles people put {{URL|www.toto.com}} for the site www.toto.com. And this gets wrongly displayed as toto.com. So we have to correct that into {{URL|www.toto.com|www.toto.com}}.
I request that removing www. not be the default behaviour. We can keep this behaviour as an option, or as another template's default behaviour.
--Nnemo (talk) 21:13, 3 September 2011 (UTC)

See also that discussion. --Nnemo (talk) 18:49, 16 September 2011 (UTC)

For St. Mary's, shouldn't you use http://www.stmaryscollegehull.co.uk/ instead of either of the URLs above?
I don't understand the issue for Toto, since both toto.com and www.toto.com redirect to http://www.toto.co.jp/en/
Further clarification would be appreciated. Thanks! GoingBatty (talk) 19:05, 29 October 2011 (UTC)
The St. Marys example is just a real world example that turned up in the article Kingston_upon_Hull - someone removed the "www" and broke the link. Yes it seems there is a redirect now.
As for "toto" - not my example - I understand that www is a subdomain and 99.9% of pages work either way - but a general principle would be to use the actual url that is used - companies have a choice and make a decision as to which url they choose - it seems to me to be a matter of being accurate - just because an alternative link works doesn't make it "right". It makes sense to me to copy the homepage url - in the case of toto.com (or www.toto.com) this is actually www.toto.co.jp as is currently used on Toto Ltd.
Imgaril (talk) 21:14, 29 October 2011 (UTC)

I say www.toto.com just as an example, as www.whatever.com.

In an encyclopedia, we should write the correct, canonical, real, Web address ; not the shortest one that happens to work thanks to various tweaks or redirections.

"Be conservative in what you send; be liberal in what you accept." http://www.postel.org/postel.html http://en.wikipedia.org/wiki/Postel%27s_law http://tools.ietf.org/html/rfc791

And we should faithfully display the link to this real Web address. Not make the link a liar link showing a Web address different than its target.

--Nnemo (talk) 18:20, 7 November 2011 (UTC)

www.

One day it's there, next day it's not... but it's back again. Do we really need to display the www prefix with this template?  -- WikHead (talk) 04:02, 30 November 2011 (UTC)

One way to ensure that the "www" isn't visible is to not put it in the template (e.g. {{URL|google.com}} shows google.com). GoingBatty (talk) 17:37, 30 November 2011 (UTC)
Thank you kindly for the tip. :) I normally just wrap this template around whatever URL exists, as its usage is suggested by Template:Infobox musical artist#website. I've probably added this template to at least a few thousand articles already, assuming that its purpose was to help address WP:BURL issues with minimal markup. At this point however, I'm not really convinced it has a purpose.  -- WikHead (talk) 20:14, 30 November 2011 (UTC)

Edit request on 6 December 2011

Mac Miller Official Website

Tylercreator (talk) 04:07, 6 December 2011 (UTC)

Not done: please be more specific about what needs to be changed. --Jnorton7558 (talk) 15:22, 6 December 2011 (UTC)

problem

there seems to be an extra bracket before and after this template. As seen on annoying orange page in the sidebar --Vera (talk) 16:55, 20 March 2012 (UTC)

I think it's that this template should not be used in {{Infobox television}}. The documentation for |website= states: "Only enter the URL; formatting is automatic." I removed the {{URL}} template from the article, and all is well now. GoingBatty (talk) 02:11, 21 March 2012 (UTC)

Archive URLs and Bot

All links eventually die. Several people ( 1, 2, 3, 4, and 5) are working on bots that fix links when they die. These bots search for archive links and add them to the article.

But it's hard for a bot to fix dead links if the template doesn't support |accessdate=, |archiveurl=, |archivedate=, |deadurl= and |bot= (see {{Cite web}}).

May I suggest that those parameters be added to {{URL}}? Blevintron (talk) 13:07, 1 April 2012 (UTC)

second the suggestion. i would extend this to apply to all templates that link to an external target, regardless of whether |url= is explicit. many of the existing external link templates should be candidates imo. 65.88.89.32 (talk) 23:57, 2 April 2012 (UTC)

an |accesstype= parameter?

is it possible to add the functionality of {{subscription required}} and {{registration required}} (and more) in this template? a single parameter with several possible values could do the job, as in

|accesstype=null [free access (default)], 1 or R [registration required], 2 or S [subscription required], 3 or P [some content at link is free, other requires subscription] etc. etc.

65.88.88.127 (talk) 21:59, 4 April 2012 (UTC)

vs. Wikipedia:Citation templates

What is Wikimedia policy regarding URL links?

I thought I had seen concerns that links giving only URLs are deprecated in favor of more complete citations such as suggested for a "website" at Wikipedia:Citation templates. A link giving only a URL may become an unsolvable mystery if the target URL is changed. A URL provided with a more complete citation provides information that in many cases would make it feasible to overcome a broken link.

DavidMCEddy (talk) 18:45, 7 June 2012 (UTC)

General use is for infoboxes - eg could be used in the company infobox in Datong locomotive factory
If I saw someone using this template for references I'd tell them to stop..
A proper example Template:Infobox writer uses it 'internally' - it is used to format web-addresses entered in the field "website". I imagine this is a good example of the general intended use.Oranjblud (talk) 23:10, 7 June 2012 (UTC)
Thanks. Could you or someone modify this Template:URL so it starts by referring users to something like Wikipedia:Citation templates except for infoboxes -- and provide a link for that? I've provided bare URLs in the past primarily because I found the template for that and I could not as easily find a more complete and preferred template at the time. Something similar should be done for Template:PDFlink. However, I don't know enough to feel comfortable doing either. Thanks again. DavidMCEddy (talk) 04:38, 11 June 2012 (UTC)
Did you mean modify the documentation so that there is an 'easement' link for people trying to find stuff? I didn't quite understand what you meant. If so I can do that.
As for finding templates - I used to have this problem - now I use Template:citation for everything (it works for all common cases, except court cases) - it is designed to work for everything too. (and make no attempt to remember any others) -the minimum you need to remember is {{citation| url = | title = }} it will add a pdf icon too if the link is a pdf - those fussy about presentation can easily change the template to the obscure other templates (eg Template:Cite conference) if the feel the need to - the syntax is generally the same - it doesn't make work for anyone.Oranjblud (talk) 13:52, 11 June 2012 (UTC)
I've added a note - if it was not what was wanted, or needs changing please say so.Oranjblud (talk) 14:11, 11 June 2012 (UTC)

Lua implementation

I've written a Lua implementation of the template in the sandbox. The actual code behind it is at Module:URL. I believe all the testcases are handled correctly, including some new ones that I added, and the "warning" and "pathological" examples now work properly because the new version does not rely on #titleparts with its 255-character limitation. This is my first go at Lua, so any feedback is appreciated. Toohool (talk) 03:26, 22 February 2013 (UTC)

Just wondering about urls with port numbers. Not that common but just wondering if the port number should be shown. -- WOSlinker (talk) 22:52, 25 February 2013 (UTC)
two small comments:
  • afaik, no need to call trim(): all parameters arrive at module (and template) trimmed by the parser.
  • however, the url might contain internal spaces. current implementation fails to take this into account. you need to replace the spaces with "+" or %20, otherwise the template moves anything after the first space from the "uri" to the "text". try {{URL/sandbox|1=en.wikipedia.org/wiki/4th of July|2=fireworks}} => fireworks (this deficiency might exist in current template also, but it's not a good reason not to fix it).
peace - קיפודנחש (aka kipod) (talk) 01:25, 26 February 2013 (UTC)
Not entirely true: although named parameters are always trimmed by the MediaWiki template parser, positional parameters like {{{1|}}} are not. Parser functions trim their output regardless of its origin, which is why {{URL}} as it presently stands contains constructs like {{#if:1|{{{1|}}}}} whose sole purpose is to strip the leading and trailing whitespace from {{{1|}}} --Redrose64 (talk) 11:52, 26 February 2013 (UTC)
thanks - i did not know that. for some reason i always thought trimming happens for unnamed args also. peace - קיפודנחש (aka kipod) (talk) 17:08, 26 February 2013 (UTC)
There are several templates that have been (or are in the process of being) converted to Lua. How is this being communicated to the Wikipedia community at large, so they know to keep an eye out for changes to their articles and know what might be causing it? Thanks! GoingBatty (talk) 14:53, 26 February 2013 (UTC)

Good catches, I've fixed the handling of URL's with port numbers, and with unencoded internal spaces. As for how conversions are being announced, there isn't really an official place.. there have been some notices at WP:VPT, as well as some discussion at Wikipedia:Lua requests. Toohool (talk) 20:24, 26 February 2013 (UTC)

Maybe a note in the Signpost would be appropriate? GoingBatty (talk) 23:55, 26 February 2013 (UTC)
The Scribunto deployment was announced in the Signpost here. Did you mean a note about this template in particular? That seems like overkill for a relatively simple template that's only used on 69,000 pages, better suited to more complicated templates that are used on millions of pages, like the core citation, infobox, and navbox templates. Toohool (talk) 00:21, 27 February 2013 (UTC)
Would something in future "In Brief" sections be appropriate, such as "This week, the following templates have been converted to Lua: __________"? GoingBatty (talk) 00:50, 27 February 2013 (UTC)
Sounds reasonable to me, but it's not really something that can be decided here. You might suggest it at Wikipedia:Wikipedia Signpost/Newsroom/Suggestions. Toohool (talk) 01:15, 27 February 2013 (UTC)
Posted at Wikipedia:Wikipedia_Signpost/Newsroom/Suggestions#Lua_deployment - thanks for pointing me in the right direction. GoingBatty (talk) 01:46, 27 February 2013 (UTC)
I'm setting up automatic unit tests for this Lua script at Module:URL/tests based on the examples on the template page and Template:URL/testcases. So far they're all passing, but more need to be added. Dcoetzee 00:44, 27 February 2013 (UTC)

The minor issues raised above have been addressed, so I'd like to request that the contents of the sandbox be copied over to the main template. Module:URL should also be fully protected at that time. Toohool (talk) 09:46, 1 March 2013 (UTC)

Question: One of the test cases doesn't behave the same way as the current template:
Is this intentional, or likely to be a problem anywhere? — Mr. Stradivarius ♪ talk ♪ 11:01, 2 March 2013 (UTC)
That was intentional. The template currently doesn't display the fragment portion of the URL, but I believe that's an unintended side-effect of using #titleparts, which doesn't return any portion of the string after a #. There's not really any logical reason to display the path portion of the URL while hiding the fragment. But if folks want to be a little more cautious, we could hide it. Toohool (talk) 20:02, 2 March 2013 (UTC)
Done Ok, it's now up live. Thanks for your efforts! — Mr. Stradivarius ♪ talk ♪ 00:31, 3 March 2013 (UTC)
I added Category:Lua-based templates as well. GoingBatty (talk) 00:37, 3 March 2013 (UTC)

The new version is causing script errors on a number of pages that pass in malformed URL's (most of the pages in Category:Pages with script errors). I've written Module:URL/sandbox, which avoids these errors by wrapping the URL parsing in a pcall (the Scribunto version of a try/catch). It also automatically fixes the common error of a URL like http:example.com or http:/example.com. I added testcases regarding these errors. Please copy the contents of Module:URL/sandbox to Module:URL. Toohool (talk) 03:11, 3 March 2013 (UTC)

DoneMr. Stradivarius ♪ talk ♪ 03:29, 3 March 2013 (UTC)

=

This template seems designed around your basic domain. What are other options for longer websites that, in my case, have an = in them? – Kerαunoςcopiagalaxies 06:13, 5 April 2013 (UTC)

See the paragraph headed "Warning:"
  • The parameters must be numbered explicitly if the URL contains an equal sign
Therefore, use |1= as illustrated by the two examples containing the query strings ?section=17 and ?page=42 --Redrose64 (talk) 14:24, 5 April 2013 (UTC)
Thank you so much Redrose64! – Kerαunoςcopiagalaxies 19:06, 5 April 2013 (UTC)

Add support for protocol-relative URLs

[1]. Test case already added. Liangent (talk) 10:27, 31 May 2013 (UTC)

Done. Thanks for your work! — Mr. Stradivarius ♪ talk ♪ 10:59, 31 May 2013 (UTC)

I am working on an article for an organization that no longer exists. The URL no longer works. Is there a way to show the URL on the info box but not make it a hyperlink so it just displays the text please? Thanks --JetBlast (talk) 22:09, 10 July 2011 (UTC)

[Belated response] Use plain text, instead of this template. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 19:16, 14 July 2013 (UTC)

Display short address that redirects to long one?

Does it fit the purpose of URL display in an infobox to show a version that is short not only by omitting a prefix but in another way?

The Newbery Medal infobox --not yet using this template-- shows the short "ala.org/alsc/newbery.cfm" which fits on one line and links to "http://www.ala.org/alsc/awardsgrants/bookmedia/newberymedal/newberymedal" which displays on three lines (at that, only because the infobox is unusually wide).

Hours ago, before noticing the Newbery infobox or template {{URL}}, I wavered on showing a long URL on three lines of the neighboring Caldecott Medal infobox. (version 2013-05-03 21:49; compare its "previous" and "newer")

Evidently short addresses similar to Newbery's function for navigation.

We may have 15 ALA awards pages so I ask here before taking a next step.

Good night. --P64 (talk) 00:06, 3 May 2013 (UTC)

the second parameter will adjust the display name, and can be used to insert line breaks if necessary to wrap the name. I, personally, don't see a problem with using 'Caldecott Medal website' for the display in that particular case. however, I do prefer seeing the URL when it isn't too long. Frietjes (talk) 18:47, 3 May 2013 (UTC)
Please see #Concern over parameter 2, below. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 19:30, 14 July 2013 (UTC)

Concern over embedding

In, for example, {{infobox hut}} this template's LUA code is being hard-coded into infoboxes.

I'm concerned that this defeats the purpose of {{URL}}, which allows two or more URLs to be entered into an infobox parameter value, or a URL plus annotative text.

How does the Lua code deal with such values? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 19:09, 14 July 2013 (UTC)

Is there a rule that some templates are permitted to invoke Lua code while others aren't? --AussieLegend () 19:32, 14 July 2013 (UTC)
I have no idea how your question is related to the issues I raised. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 19:34, 14 July 2013 (UTC)
No, it's not a rule. I think the reason is more that most of the infoboxes that have a url param don't to any processing of the link, so for example if we have
Infobox person
Websitewww.example.com
Infobox hut
Website[[2] www.example.com%20www.example.com]]
{{Infobox person
|name = Infobox person
|website = [http://www.example.com www.example.com]
}}
{{Infobox hut
|name = Infobox hut
|url = [http://www.example.com www.example.com]
}}


Infobox person
Websitewww.example.com
Infobox hut
Website[<span%20class="url">.example.com www.example.com%20www<wbr/>.example<wbr/>.com]</span>]
{{Infobox person
|name = Infobox person
|website = {{URL|www.example.com}}
}}
{{Infobox hut
|name = Infobox hut
|url = {{URL|www.example.com}}
}}


What I think needs doing is that the module should be updated so that if a link is passed through then the module doesn't do anything to it and just output what was input.

  • Code: {{URL|{{URL|www.example.com}}}}
  • Live: [<span%20class="url">.example.com www.example.com%20www<wbr/>.example<wbr/>.com]</span>]
  • Sandbox: [<span%20class="url">.example.com www.example.com%20www<wbr/>.example<wbr/>.com]</span>]

-- WOSlinker (talk) 20:25, 14 July 2013 (UTC)

I've updated Module:URL/sandbox to avoid double processing. If everyone is happy with then then it can be put into the live template. -- WOSlinker (talk) 20:33, 14 July 2013 (UTC)

{[od}} How does this cater for the two cases I gave above? Such as:

url = example.com<ref>Foo</ref>

or

url={{Plainlist| 
* example.com
* example.net}}

? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 20:46, 14 July 2013 (UTC)

Plainlist works mainly because that template code begins with a < and because the edit I did in the sandbox is only checking for url params that begin with a [ or < and then not processing them. The one with the ref doesn't work and the moment and would need extra coding to handle. -- WOSlinker (talk) 21:07, 14 July 2013 (UTC)

My point is that these things work in infobox templates which don't have the module embedded, and where the editor has the choice of where and how to use {{URL}}:

url = {{URL|example.com}}<ref>Foo</ref>

or

url={{Plainlist| 
* {{URL|example.com}}
* example.net}}

I don't see the advantage of embedding, over what we can do that way. Also, embedding will break any examples which are already formatted like these latter cases. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 21:15, 14 July 2013 (UTtC)

Most infoboxes don't do anything with websites because there wasn't seen to be a need to do anything when they were created. However, clearly there was, which is why this template was created. Infoboxes that call this template have traditionally done so because the code was far too complex to justify including in the template code for numerous reasons that I really shouldn't need to explain. With the advent of Lua, this has changed, so rather than call this template, which is just calling the Lua code, it's just as easy to embed the call to the code directly. It's simple, doesn't take up space and doesn't result in the massive duplication of code that would lead to maintenance issues as was the case with the pre-Lua code. Andy, I asked the question because you were concerned that another template was calling Lua code directly, as if there was something wrong with that, and there clearly is not. The template that prompted this discussion is used in a mere 40 articles and the concerns you've expressed simply don't apply. If it was {{Infobox person}}, which is used in 130,000 articles, there might be an issue but with such a low use template, it was a simple task with AWB to standardise all articles so that they match the documentation. You're really making a mountain out of a molehill here. @WOSlinker now, thanks for acting so quickly. I'm happy with your resolution. --AussieLegend () 08:12, 15 July 2013 (UTC)
You don't appear to address either of the issues I raised. I'll thank you to not dismiss them as "making a mountain out of a molehill", since they not; they are valid concerns. Nor have I raised any general concerns about templates calling Lua directly. Your "Infoboxes that call this template have traditionally done so because the code was far too complex to justify including in the template code for numerous reasons" is a false claim. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 15:43, 15 July 2013 (UTC)
Your issues are not issues that concern {{Infobox hut}} for the reasons that I have explained so yes, it is making a mountain out of a molehill. You're correct that you didn't make general concerns, your concerns were quite specific: "In, for example, {{infobox hut}} this template's LUA code is being hard-coded into infoboxes. I'm concerned that this defeats the purpose of {{URL}}". Why, exactly, is my claim untrue? --AussieLegend () 17:57, 15 July 2013 (UTC)

Import URL from Wikidata

This template doesn't clean up the syntax when importing the URL from Wikidata. See the infobox of Paniqui, Tarlac, for example. The URL should read www.paniqui.gov.ph when using this template, but instead it shows the entire string (http://www.paniqui.gov.ph/). Can this be corrected? -- P 1 9 9   17:23, 12 September 2013 (UTC)

I've marked this request as answered for now, as edit requests are only supposed to be used for requests where the code changes are trivial or where the code is written and has been tested. If no-one at this talk page can help, maybe try and WP:VPT? — Mr. Stradivarius ♪ talk ♪ 22:03, 12 September 2013 (UTC)
I replied at Wikipedia:Village pump (technical)#Import URL from Wikidata. When a url is retrieved from Wikidata, the colon is encoded as &#58;. I have tested the same happens on other articles but I haven't tested whether other characters are altered. I don't know why the colon is encoded. I asked at wikidata:Wikidata:Project chat#URL datatype is here with no answer. Maybe Module:URL should convert &#58; to a colon. PrimeHunter (talk) 20:35, 18 September 2013 (UTC)
I've updated Module:URL to handle the &#58; -- WOSlinker (talk) 21:02, 18 September 2013 (UTC)
Thanks. wikidata:Wikidata:Project chat#URL datatype is here now says the colon encoding is filed as bugzilla:54312. PrimeHunter (talk) 10:18, 19 September 2013 (UTC)

Concern over parameter 2

This template should not be used to display text other than a URL. Its explicit purpose is to wrap the displayed URL in an HTML class as part of the microformat emitted by the parent infoboxes. Where it is necessary to display text (e.g. BBC website] instead of bbc.co.uk), ordinary wiki markup, not this template, should be used. I've amended the documentation accordingly. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 19:33, 14 July 2013 (UTC)

I propose that we remove this parameter; since it defeats the purpose of using the template. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 23:59, 19 December 2013 (UTC)
Generally agree - what about breakage - did anyone ever uses parameter 2 ? Prof.Haddock (talk) 16:42, 20 December 2013 (UTC)
If its not to be used then it should be removed as an option altogether, telling a user how to do something there not supposed to is highly problematic. Personally think theres very little consensus backing it up but would prefer removal if to stay depreciated.Blethering Scot 17:10, 20 December 2013 (UTC)
@Prof.Haddock: Perhaps a tarcking category could answer that? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 17:43, 20 December 2013 (UTC)
Ive started a RFC that includes removing this parameter here.Blethering Scot 18:08, 20 December 2013 (UTC)

Parameter 2 display text "Deprecated" -> {{Citation|...}} or {{plainlink|...}}?

Could someone add links to {{Citation|...}} and {{plainlink|...}} in at least one of the places where it says the second parameter, display text, is "deprecated"?

A few years ago, I saw that this second parameter was "deprecated", but I didn't see the alternatives. As a result, I've been using it. Only today did I notice the reference to {{plain link}} under "See also" in the article. Then I looked for "Deprecated" in the Talk page and found {{Citation|...}} suggested for essentially the same purpose. I then experimented and found that these two alternatives do slightly different things.

I think it would help to have the word "Deprecated" in this article followed by reference to the preferred alternative(s). In particular I think it would help to have the options "Deprecated" in the table followed by "Preferred" examples using both {{plain link|...}} and {{Citation|...}}. Thanks, DavidMCEddy (talk) 17:38, 2 February 2014 (UTC)

Add support for text and spaces and upperletters

Hi please add support for adding text for example {{url|example.com|Example website}} it should show what you wrote exactly but it doesent. It only show the text in lowercases and you have to add _ to be able to show that it has a space. Please fix issue Paladox2017 (talk) 16:24, 27 February 2014 (UTC)

No thanks. The purpose of this template is explicitly to display, the URL, and to and emit the displayed URL as metadata; it is not to display link text. For what you want, just use a standard wikilink. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 17:36, 27 February 2014 (UTC)

www prefix if present please

See Template_talk:URL#Exclusion_of_prefix_is_technically_and_in_some_cases_practically_wrong

Case in point http://www.jonathanmeades.com/ and http://jonathanmeades.com/ - the fact is the current removal of www is just plain wrong. Can someone fix this please.Oranjblud (talk) 13:29, 6 April 2012 (UTC)

According to the template documentation, if an editor puts "www" inside {{URL}}, the "www" will be displayed and part of the link. For example:
Could you please state exactly what you want fixed? Thanks! GoingBatty (talk) 14:35, 6 April 2012 (UTC)
That's weird I was sure it was chopping the www - yes that's fine thanks! Oranjblud (talk) 14:52, 7 April 2012 (UTC)
I see the same document at either URL. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:49, 22 August 2014 (UTC)

Option to trim leading www

are there any objects to add an option that would trim the leading www? this would help with cases like Guimaras where the infobox is stretched from the longer URL. Frietjes (talk) 16:53, 1 June 2014 (UTC)

Yes; some sites serve different content at www.example.com and example.com forms. If the URL is too long, try wrapping the template with <small> tags; or consider modifying the template so that the URL occupies the full width of the box. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 21:38, 1 June 2014 (UTC)
Small tags? Aren't those deprecated per accessibility guidelines? Plastikspork ―Œ(talk) 22:20, 1 June 2014 (UTC)
I would support having an option to trim the www, so long as it isn't the default. The template used to function this way when it was originally created. Also, the trailing main.php and index.php for many URLs is also unsightly. Thanks! Plastikspork ―Œ(talk) 22:19, 1 June 2014 (UTC)
AIUI, that functionality was changed, for the reason I gave above. Trailing main.php. etc, should be removed from the input data. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 11:26, 3 June 2014 (UTC)
What's the point of having an option to trim www? Any user adding a parameter to request that could just remove www more easily on their own. An option to keep www with the default being removal would make more sense. PrimeHunter (talk) 11:34, 3 June 2014 (UTC)
I fixed the Guimaras example for you. Thanks! Plastikspork ―Œ(talk) 22:22, 1 June 2014 (UTC)

As per MOS:WEBADDR, "www." can be ommitted; the target is printed media. In the case of Debian, the URL without "www." works as a redirect, so "www." should be used in the first place. The "External links" tool reports only 200 (and 0) HTTP responses, following the spirit to offer "our very best work" in a featured article. The usage of "[ ]" discards class="url".

There should be an option to trim the leading "www." from the displayed URL; otherwise, the second parameter should not be deprecated for the purpose of omitting "www.". 84.127.80.114 (talk) 13:26, 22 August 2014 (UTC)

Is there some reason you couldn't just use {{url|debian.org}} instead of {{url|www.debian.org|debian.org}}? They go to the same place for 99.99% of domains. Toohool (talk) 00:09, 29 August 2014 (UTC)
Is my explanation that long? debian.org is a 301 HTTP redirection. Examples without microformat: BHaG, CNET and CNN. Example with microformat: Microsoft. 84.127.80.114 (talk) 03:57, 29 August 2014 (UTC)
What difference does it make that it's a redirect? That seems to me a pedantic distinction that nobody would care about. And what has a microformat got to do with it? Toohool (talk) 05:37, 29 August 2014 (UTC)
Maybe it is a pedantic distinction, but I will wait until the FAC process decides otherwise. Regarding microformat, please read Template:URL and the purpose of this template. I hope that the second parameter is not dropped until proved totally useless. 84.127.80.114 (talk) 21:49, 29 August 2014 (UTC)
I would like to note that I know that Toohool has written Module:URL. 84.127.80.114 (talk) 22:06, 29 August 2014 (UTC)
My point was, what's the microformat got to do with {{url|debian.org}} versus {{url|www.debian.org|debian.org}}? You get the microformat either way. And I guess you are saying that there is some external links tool used at FAC that flags any 301 links as a problem? I guess I don't see that as much of a reason for this template to support this weird redundant way of being invoked. Plus it violates the very MOS:WEBADDR you pointed to, which encourages using a more reader-friendly redirect URL if it's available. Toohool (talk) 01:28, 30 August 2014 (UTC)
Method Printer-friendly No redirect Microformat
[http://www.debian.org debian.org]
{{url|www.debian.org}}
{{url|debian.org}}
{{url|www.debian.org|debian.org}}
84.127.80.114 (talk) 03:59, 30 August 2014 (UTC)
Again, who cares if there's a redirect? The FAC external links tool is not in charge of Wikipedia. Toohool (talk) 05:08, 30 August 2014 (UTC)
The tool did not make the decision; I did, with the help of the tool. That decision is because of maintenance, the same reason I am using Template:URL instead of embedding <span class="url">[http://www.debian.org debian.org]</span> directly. Who cares for redirects? Who cares for compiler warnings? Who cares if an old URL did not work two days ago? I do not know, perhaps no one does. 84.127.80.114 (talk) 01:26, 31 August 2014 (UTC)

The following link breaks the template.

http://www.microsoft.com/en-us/download/details.aspx?id=3702

When used with the URL template, it produces:

www.microsoft.com/en-us/download/details.aspx?id=3702

In trying to troubleshoot it, I found that removing the '?id=3702' from the end of the URL makes it work (although obviously it doesn't go where it should). It'd be nice if this was fixed.

--Dziban303 (talk) 11:23, 14 November 2014 (UTC)

It's because the URL has an = in it. Prefix the url with 1= to get it to work. -- WOSlinker (talk) 12:15, 14 November 2014 (UTC)
www.microsoft.com/en-us/download/details.aspx?id=3702

Empty case

Currently, if no parameter is passed, the return is {{URL|example.com|optional display text}}.

Fair enough, but if this is used for a general case extracting wikidata, and wikidata for this instantiation is null (not present) then the return should be null rather than the error condition. It should be quite easy I think to check if |1=property.... Failing that, there could be a third parameter, e.g. |property=true

--Roger Camotes (talk) 00:33, 2 January 2015 (UTC)

Template-protected edit request on 19 March 2015

I work at SQS Software Quality Systems AG and we are generally known as the acronym SQS. However the title of the page is just Software Quality Systems so does not come up under searches for SQS.

Please could this be rectified? Emily Emilysqs (talk) 15:03, 19 March 2015 (UTC)

Not done: this is the talk page for discussing improvements to the template {{URL}}. You're looking for Talk:Software Quality Systems AG instead, and probably WP:Requested moves. However, we don't usually include acronyms in titles due to our article titles policy. If it makes you feel any better, SQS is the third link at the SQS disambiguation page. — Mr. Stradivarius ♪ talk ♪ 15:13, 19 March 2015 (UTC)
Emilysqs: (notifying) — Mr. Stradivarius ♪ talk ♪ 15:16, 19 March 2015 (UTC)

Although this module has nearly 200,000 transclusions the documentation page is inadequate. It says the module is in alpha ("may be used on a few pages to see if problems arise") and the first line is complete nonsense ("The module “URL” contains (specify) available calls that make so and such"). Could any of the editors who have worked on this module (Toohool, Mr. Stradivarius, Codename Lisa) , please upgrade its documentation? Thank you — Martin (MSGJ · talk) 20:26, 6 June 2015 (UTC)

That's just the old default doc template for modules, so it amounts to no documentation at all. (You can see the template here.) I'll try and update it when I have a spare moment, but if anyone gets there first, feel free. — Mr. Stradivarius ♪ talk ♪ 22:50, 6 June 2015 (UTC)
For now, I've just replaced it all with a link to {{URL}}. — Mr. Stradivarius ♪ talk ♪ 22:54, 6 June 2015 (UTC)
Okay thanks. Having nothing is better than having something misleading ;) — Martin (MSGJ · talk) 08:24, 8 June 2015 (UTC)

Deprecated?

Hi. Why is the 2= option marked as "deprecated"? What does that mean? Deprecated in favor of what? It's necessary. How can we not have an alternate text for a url? How else are we supposed to give the names of websites in the External links section? Thanks. — Smuckola(talk) 09:25, 3 December 2015 (UTC)

The whole point of using {{URL}} is to both make a link and display the url. The documentation says:
If you wish to display text instead of the URL (e.g. "BBC website" instead of bbc.co.uk), please do not use this template.
If you don't want to display the url then just use the normal notation at Help:Link#External links, or see Wikipedia:External links. PrimeHunter (talk) 16:04, 3 December 2015 (UTC)

Case issues

I expect to have my casing shown in the presentation of the URL. Example: If I type TransUnion.com, I would like it to stay that way, not transunion.com - which is nearly eligible to me, have to work hard at it though. Is this even a possibility? ~~ 68.41.184.209 (talk) —Preceding undated comment added 01:24, 14 May 2016 (UTC)

Template-protected edit request on 8 October 2016

Could someone please re-add the {{Tfm/dated|page=URL|otherpage=Official URL|link=Wikipedia:Templates for discussion/Log/2016 October 8#Template:URL|type=tiny}}(possibly in noinclude tags) incorrectly removed by CFCF while a merge discussion is in progress that could possibly change this template by introducing wikidata suppport. Pppery 15:41, 8 October 2016 (UTC)

 DoneMRD2014 (talkcontribs) 17:17, 8 October 2016 (UTC)
Actually I removed it because CFCF earlier said that message did not need to be there. —MRD2014 (talkcontribs) 17:20, 8 October 2016 (UTC)
@MRD2014: It is necessary, per standard procedure of nominating two templates for merging at tfd, the "this template is being considered for merging" notice is placed on both. Pppery 17:26, 8 October 2016 (UTC)
@Pppery: Thanks. @CFCF: Apparently the TFM template has to be on this template too. —MRD2014 (talkcontribs) 17:32, 8 October 2016 (UTC)

Template-protected edit request on 8 October 2016 (2)

Could someone please remove the newline between the noincluded tfd notice at the top and the rest of the template code. It is escaping into pages transcluding the template. Pppery 19:13, 8 October 2016 (UTC)

Done. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 19:46, 8 October 2016 (UTC)