Template talk:IMDb name

From Wikipedia, the free encyclopedia
  (Redirected from Template talk:IMDb name/sandbox)
Jump to: navigation, search
WikiProject Film (Rated Template-class)
WikiProject icon This template is within the scope of WikiProject Film. If you would like to participate, please visit the project page, where you can join the discussion and see lists of open tasks and regional and topical task forces. To use this banner, please refer to the documentation. To improve this article, please refer to the guidelines.
 Template  This template does not require a rating on the project's quality scale.
For the old discussion about the development of this template, see this page

Fun little external link icon[edit]

If you have a browser that shows the external link icon (External.png) then you can set any IMDb links to show its own icon (IMDb external.png)

Check out m:Help:User style for more info on CSS selectors.

Edit your "User:{your login}/monobook.css" (replace {your login} with your username) and add:

#bodyContent a[href *="imdb.com/"],
#bodyContent a[href *="imdb.co.uk/"] {
        background: url(http://upload.wikimedia.org/wikipedia/en/5/53/IMDb_external.png) center right no-repeat;
        padding-right: 13px;

Once you save the page, you may need to hold Shift and click Reload.

Please see help on m:Help:User style

Do you see it here on this plain link?
or on this interwiki link?

— Preceding unsigned comment added by Fitch (talkcontribs) 01:25, 12 January 2006

Bug? breaking because of leading 0 omitted[edit]

At WP:OTRS ticket:2016051510011261 a reader writes in saying that links generated by this template are broken for them, and always lead to an HTTP 404. I am unable to replicate this outcome, and for me, the links work. The reader says that the problem is the omission of leading zeros in the URL.

Somehow I am redirected, but some other people report not being redirected.

In the archives, another user had the same complaint.

I am telling the reader that I am noting the issue, but I am not sure how to address it further. Thanks to anyone who has insight and can address the issue. Blue Rasberry (talk) 15:06, 17 May 2016 (UTC)

  • Based on a note in the description of this template, it appears the leading 0 is not auto-added by IMDb for the mobile site. I had to update one page as it failed on my phone, but worked on the computer. Maybe a bot should be created that will double-check all IMDb links and add missing leading zeroes until it is the full 7 digits, or if the template can be updated to do that itself. I'm guessing this affects all variants of this template. Andyross (talk) 15:07, 22 September 2016 (UTC)
I have confirmed the explanation above by Andyross. This issue is a problem at the imdb.com website for mobile users. On a Windows laptop, the IMDb website automatically redirects http://www.imdb.com/name/nm148/ to http://www.imdb.com/name/nm0000148/, which works correctly. But on an Android smart phone, the IMDb website redirects that URL to http://m.imdb.com/name/nm148/ without the leading zeros, which does not work. On the phone, if the URL http://m.imdb.com/name/nm0000148/ is manually entered in the mobile browser, the web page is displayed correctly.
This mobile device problem was raised at IMDb three years ago, and the response was to have Wikipedia fix the issue.
Having a bot edit the numerous pages that use this template to expand the ID to seven digits would be a huge number of edits, with some risk involved. On the other hand, if this template could automatically pad the ID to seven digits, there would be a single edit (to the template) to fix the issue. I have just made a number of page edits to correct this mobile issue, and I imagine other editors have done the same. The template fix would certainly be a time-saver, and would solve the issue immediately. CuriousEric 00:28, 29 December 2016 (UTC)
I've put some changes in the sandbox, but could do with a bit of further testing before deployment. -- WOSlinker (talk) 10:04, 29 December 2016 (UTC)
WOSlinker, thank you for working on the template. I ran the test cases in the sandbox in Windows and on an Android mobile phone. The template changes in the sandbox fixed the mobile issue in the short test "1109". I also tested cases using ID "1" (which is Fred Astaire) to verify it worked with single digits (which it did), but was not sure if those cases should be permanently added. I did add another short test using "nm1109" which did not work on mobile unfortunately. I recommend this case be fixed as well, if not too much trouble. CuriousEric 15:44, 29 December 2016 (UTC)
Wasn't sure if anyone would ever put nm with a shortened number as when the urls are like http://www.imdb.com/name/nm0000148 wouldn't people either take the full nm+number or just the number as the parameter? -- WOSlinker (talk) 18:48, 29 December 2016 (UTC)

────────────────────────────────────────────────────────────────────────────────────────────────────I'm not sure either, I haven't seen "nm" with a short number in an article... just thought I'd try it. If you think it's not used (which may be the case), feel free to revert my test case for it. In which case the template change fixes the mobile "short number" issue as-is. If "nm" with a short number is found to be used later, the template could be enhanced if needed. Thanks. CuriousEric 22:02, 29 December 2016 (UTC)

I've made the changes in live now and also added a tracking category for that type of parameter at Category:IMDb template with invalid id set, so it will be possible to see if anythig does it that way. If everytihng works ok, will look at also doing {{IMDb title}} in a few days. -- WOSlinker (talk) 22:46, 29 December 2016 (UTC)
Thank you for adding the category. It showed 11 incorrect uses of {{IMDb name}} which I have fixed. Some uses were unexpected, such as "/" after the ID, which broke the link for non-mobile users. CuriousEric 16:05, 30 December 2016 (UTC)

Requested edit for "Edit at Wikidata" link[edit]

Could someone please paste the following immediately after the open <includeonly> tag:


to add the blue {{EditAtWikidata}} pencil. I've added the same to the sandbox already. — OwenBlacker (talk) 19:12, 5 March 2017 (UTC)

Done — JJMC89(T·C) 19:30, 5 March 2017 (UTC)