Template talk:Official website/Archive 4
This is an archive of past discussions about Template:Official website. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | Archive 2 | Archive 3 | Archive 4 |
Proposed edit: Indicate language of website
This template already has logic that iterates through all the official websites on Wikidata, and selects one that has 'language of work or name' set to English, if available. However, some items don't have English websites, and then the template is forced to link to a foreign language website instead. When this happens, I propose that the output of this template include a note like "(in [some language])" (assuming there is a 'language of work or name' qualifier set). Otherwise, someone will have to manually add {{link language}}, defeating the purpose of using Wikidata.
To give an example: here's what it'd look like on "El capo":
- Official website (in Spanish)
–IagoQnsi (talk) 17:40, 2 August 2018 (UTC)
- This is not unreasonable, and there's a comment section in the archive about it. Feel free to hack on Module:Official website/sandbox. :) --Izno (talk) 18:16, 2 August 2018 (UTC)
- @Izno: Cool, I went ahead and implemented it; try previewing {{Official website/sandbox}} on various articles. In addition to supporting language qualifiers on Wikidata, the template now supports a new parameter "lang" (because otherwise that functionality would be walled off/editors wouldn't be able to override it).
- The code for this got a little more complex than I expected. The way that {{link language}} converts language codes to the name of a language is with the templates in this category. The templates mostly use ISO 639 codes, but there's also a few IETF codes tossed in. I wanted to use the same system as {{link language}} so that this module would have identical output (and would be able to use the same tracking categories), but that template's hodge-podge of code systems isn't guaranteed to be 100% compatible with Wikidata. So, my code will attempt to get the label from the Wikipedia templates, but if that fails, it'll fall back to using the Wikidata label (and also won't include a tracking category—perhaps we should have new category, Category:Articles with unknown non-English-language external links?). The fallback should be pretty rare, limited to really obscure dialects or what have you.
- I've tested that it works with every weird case I can think of. The only caveat I know of is that, while it will omit the language note if the Wikidata language is "English", it won't detect dialects of English (so it would print a language note for, say, American English). This is fixable if we want; I just left it this way because the
isEnglish()
function that already existed in the module was written this way. - Anyway, that's my implementation—please let me know what you all think of actually going live with it! Thanks, IagoQnsi (talk) 00:56, 3 August 2018 (UTC)
- We should consider making use of the work that has been done for Module:Lang. --Izno (talk) 12:50, 5 August 2018 (UTC)
No need for additional parameter. These changes can happen to Wikidata and this template to only use wikidata as source. -- Magioladitis (talk) 18:44, 2 August 2018 (UTC)
- Huh? Did you actually read the problem statement? --Izno (talk) 20:41, 2 August 2018 (UTC)
- Izno My idea is the following: We don't need an extra parameter for that. We can add the language identifier in Wikidata and if does not match the project language to add "(in [some language])" automatically. So the display can 100% be controlled via Wikidata. I think this is possible. Is this what you implemented? -- Magioladitis (talk) 22:48, 2 August 2018 (UTC)
- @Magioladitis: That is exactly what I'm proposing. –IagoQnsi (talk) 00:56, 3 August 2018 (UTC)
- @IagoQnsi: Then I agree! In the past, there were different approaches. I think this is the best! This will also resolve many problems. -- Magioladitis (talk) 07:38, 3 August 2018 (UTC)
- @Magioladitis: That is exactly what I'm proposing. –IagoQnsi (talk) 00:56, 3 August 2018 (UTC)
- Izno My idea is the following: We don't need an extra parameter for that. We can add the language identifier in Wikidata and if does not match the project language to add "(in [some language])" automatically. So the display can 100% be controlled via Wikidata. I think this is possible. Is this what you implemented? -- Magioladitis (talk) 22:48, 2 August 2018 (UTC)
@IagoQnsi: I updated Module:Official website/sandbox function renderTrackingCategories to prevent adding a language category when the "No URL found" error message is displayed. For example, {{Official website/sandbox|lang=es}} used in an article without Wikidata property official website (P856) was adding the article to Category:Articles with Spanish-language external links. I also made two other changes which I began working on in June, unrelated to your edits in the /sandbox:
- In function renderUrl, if the module displays a link using a URL from Wikidata then add an icon/link in the same format as used by Module:EditAtWikidata (see discussion above in § Edit in Wikidata link).
- In function p._main, assign fetchWikidataUrl() to
wikidataurl
and pass that to renderUrl for reason described above; also pass that to renderTrackingCategories instead of the second call to fetchWikidataUrl().
I tested these changes with previews in articles and they appear to be working correctly. I also updated {{Official website/sandbox}} so that calling it with |lang=
does not cause {{#invoke:Check for unknown parameters|function}} to display an error message in the preview. Finally, I added some tests for |lang=
in Template:Official website/testcases and created Module:Official website/testcases. -- Zyxw (talk) 21:07, 3 August 2018 (UTC)
Edit in Wikidata link
Note: This was split from § Addition of HTTPS upgrade parameter
- Follow up question: if the URL is read from Wikidata, shouldn't we add the "Edit this in Wikidata"-link (the pencil)? For example, the International Olympic Committee link would look like (constructed here for demo, using {{EditAtWikidata}}):
- - DePiep (talk) 08:01, 21 April 2018 (UTC)
- Stretching this idea: add the pencil too when the page is in the WD-tracking categories (like Category:Official website not in Wikidata (48,640)). However, this would be by a different concept (cleanup maintenance instead of straight editing!). - DePiep (talk) 08:15, 21 April 2018 (UTC)
See also: Template_talk:Official_website/Archive_3#missing_"edit_wikidata"_link_when_using_template. -- Magioladitis (talk) 23:47, 10 May 2018 (UTC)
- @DePiep: I would gladly support the pencil icon in general. I suggest that it is most useful when the URL is in Wikidata and not in Wikipedia, and should be shown only in this case. However, I think it would be fine to show it all the time. The major objection to templates which pull from Wikidata is that they are difficult to edit; this is a great solution and that small icon is fairly unobtrusive. Daask (talk) 13:37, 11 May 2018 (UTC)
- Agreed, simple solution to a difficult problem. I would prefer to see the pencil only when the underlying data is on Wikidata so that it serves two purposes - to edit the data, and an indicator the data is imported from somewhere else. Otherwise pencils will be everywhere in every field of infobox etc.. -- GreenC 15:24, 11 May 2018 (UTC)
- @DePiep: I would gladly support the pencil icon in general. I suggest that it is most useful when the URL is in Wikidata and not in Wikipedia, and should be shown only in this case. However, I think it would be fine to show it all the time. The major objection to templates which pull from Wikidata is that they are difficult to edit; this is a great solution and that small icon is fairly unobtrusive. Daask (talk) 13:37, 11 May 2018 (UTC)
I would like to see at some point this info to be stored an retrieved only to/from Wikidata and be easily editable via English Wikipedia. -- Magioladitis (talk) 16:36, 11 May 2018 (UTC)
- @DePiep, Daask, GreenC, and Magioladitis: I implemented this in Module:Official website/sandbox (incorporated with a different update which IagoQnsi is working on, described in the section below). The edit icon/link uses the same format as EditAtWikidata, for consistency with other external link templates using Wikidata. It is only displayed when the link is using a URL from Wikidata property official website (P856). This update can be tested by previewing {{Official website/sandbox}} in an article. -- Zyxw (talk) 01:52, 4 August 2018 (UTC)
- Zyxw I tried at The New York Times and works as expected. Nice work. -- GreenC 18:28, 4 August 2018 (UTC)
- I implemented this in the module today (diff). The changes related to the language of the link are still pending (diff). -- Zyxw (talk) 21:01, 12 August 2018 (UTC)
Official blog
I'm wondering the best way to provide access to official blog URL (P1581). We could have a separate template, but I suggest adding a |blog=yes
parameter to this template. This would use official blog URL (P1581) intead of official website (P856), and have default text of "Official blog" instead of "Official website". What do others think? Daask (talk) 13:00, 12 September 2018 (UTC)
- WP:ELMINOFFICIAL: If we have an official website, we should simply provide that. If we have both, we still only provide the official website. If there is an official blog but not an official website, I don't have an issue with providing that (I don't see a need for different verbiage). I wouldn't want that to be a user-selectable option, however--if we want it, we should get it from Wikidata. --Izno (talk) 17:51, 13 September 2018 (UTC)
Template broken
Hi, it appears that the template is broken and just gives this error : Lua error in Module:URL at line 31: attempt to index local 'msg' (a nil value). — Preceding unsigned comment added by Lastrik (talk • contribs) 22:39, 24 February 2019 (UTC)
- This has been fixed in Module:URL.[1] PrimeHunter (talk) 00:56, 25 February 2019 (UTC)
Wikidata tracking
See discussion Wikipedia talk:Wikidata#Redundant parameters in wikidata tracked templates. Bogger (talk) 10:14, 1 September 2019 (UTC)
Request to replace all transclusions of Template:Official with Template:Official website
Would there be any opposition if I replace all appropriate transclusions of {{Official}} with {{Official website}} without making any additional edits to the transclusions other than bypassing the template redirect? Asking since due to the fact that there are currently over 20,000 transclusions of {{Official}}, I can see how this could potentially be controversial. Steel1943 (talk) 19:10, 8 July 2019 (UTC)
- Steel1943: (delayed response due to LONG wikibreak:) Since there are so many transclusions, a TFD or RFD may be the most appropriate way to deal with this. To my mind, {{Official}} is quite ambiguous and should be discouraged, but we should have a real discussion at an appropriate venue. – Jonesey95 (talk) 19:39, 3 September 2019 (UTC)
Page in Webarchive only?
The official website in Sylvain Luc#External_links might be nice, if you are speaking french and need to fix(?) your roof … hmm :-/ In Wikidata I added an archived version of the guitarist's website, but it does not show up here? was my edit in Wikidata wrong or does the template/module ignore the webarchive? --Wurgl (talk) 07:28, 8 October 2019 (UTC)
- This template does not yet understand/know about archive URLs in the context of Wikidata. I'm not even sure it knows about it without Wikidata. --Izno (talk) 20:32, 9 October 2019 (UTC)
Following up on Proposed edit: Indicate language of website
@IagoQnsi, Izno, Magioladitis, and Zyxw: I'm following up on the discussion now at Template talk:Official website/Archive 4#Proposed edit: Indicate language of website. Were there any issues with the sandbox edit? Is this ready to be implemented? Thanks! GoingBatty (talk) 02:06, 23 September 2019 (UTC)
(Mobile), (Requires...)
I do not see any reason to have capital here. Please change it to (mobile) and (requires...) in the module code. I think this is analogy with {{asof}}'s param |lc=yes
for when "as of" text is not at the beginning of the sentence or table field. --Obsuser (talk) 17:37, 12 December 2019 (UTC)
- Or indeed analogous with {{lang icon}}. – Finnusertop (talk ⋅ contribs) 22:49, 12 December 2019 (UTC)
Noprint
Add span class noprint in order to prevent pencils from being printed as they are not useful in printed articles. --5.43.82.5 (talk) 22:52, 2 March 2020 (UTC)
Not picking correct URL for AFNOR
AFNOR (Wikidata) has multiple official websites, and only one of them has the language marked as English. However, the template is picking the preferred one in French. The template documentation says that "[i]f on Wikidata more than one official website is given, the entry tagged with the language being English is automatically preferred," but this doesn't seem to be happening in this case. Perhaps it's due to a corner case of having two preferred values for the official website property? Logan Talk Contributions 02:14, 25 October 2020 (UTC)
- I see you edited the Wikidata item very recently. I don't know, but you might have to wait 24 hours or longer for the change to be noticed. Johnuniq (talk) 02:34, 25 October 2020 (UTC)
- Yes, it's an issue of someone or another's job queue and/or purging and/or null editing. --Izno (talk) 02:53, 25 October 2020 (UTC)
Shouldn't this template read Wikidata's P407 (language of work or name) qualifier?
In cases where there is no English version of the official website, it would be nice to have the option to fetch the P407 (language of work or name) qualifier - it is required on Wikidata - and embed its content within a Template:in lang
template. Iketsi (talk) 08:59, 23 January 2020 (UTC)
- That would be nice. Are you willing to sandbox the template to do so? :) --Izno (talk) 03:22, 24 January 2020 (UTC)
- It would also be nice if it handled the P1065 (archive URL) qualifier when provided. This template currently links to dead links, otherwise. - Iketsi (talk) 06:17, 29 December 2020 (UTC)
Pencil icon
For websites where a URL is not provided, the template relies on Wikidata information. I like doing this, as it abides by the don't repeat yourself principle, consolidating where we host information. However, I don't like that it creates a distracting pencil icon next to the URL. Is it really necessary to have this icon? As a potential alternative, we could just put a notice at the top of the template documentation here explaining that if you're here since you'd like to update a website that isn't specified on the page, just go to Wikidata. {{u|Sdkb}} talk 23:16, 22 July 2021 (UTC)
- Having a link to edit Wikidata makes it easier to figure out how to correct any errors/update to a new website (and therefore more likely to happen). I think that's better. WhatamIdoing (talk) 16:56, 23 July 2021 (UTC)
- Very much agree with WhatamIdoing because it makes the fact that wikidata is being used explicit and it makes wikidata discoverable. —Joeyconnick (talk) 02:40, 29 July 2021 (UTC)
- I'm with Sdkb on this one, and find it a bit distracting too. The vast majority of folks using Wikipedia are readers. This icon applies to a slim fraction of a percent of folks that might want to click it to update/modify the entry. Perhaps this icon should only be visible for users that are logged in, but otherwise not shown. There must be a CSS-way to enable this. +mt 20:52, 29 July 2021 (UTC)
Infoboxes
At this time, it doesn't make sense to use the {{Official website}} template in infoboxes, because it doesn't show a URL to users which is useful in infoboxes. Somehow the matter should be resolved so that the official website link in the infobox could also be taken from Wikidata using the {{Official website}} template. Or if not with this template, then with someone else? {{URL}}? --Avoinlähde (talk) 21:17, 28 March 2022 (UTC)
- Anyone have an idea? Avoinlähde (talk) 19:00, 4 April 2022 (UTC)
- I think using the {{Official URL}} template in the infobox would give you what you are looking for. Best, UnitedStatesian (talk) 17:41, 20 April 2022 (UTC)
- I made a request for the change at Template talk:URL#Template-protected edit request on 15 May 2022 - DownTownRich (talk) 17:36, 15 May 2022 (UTC)
- I think using the {{Official URL}} template in the infobox would give you what you are looking for. Best, UnitedStatesian (talk) 17:41, 20 April 2022 (UTC)
Doesn't work with multiple official sites
In my case, it was Drakengard (video game), which has 2 entries of official sites in Wikidata, with addition 1 archived site. If I am use this feature, I should not be required to manually paste links to specify an individual instance. Furthermore, the template should by default generate all official sites from Wikidata instead of just 1, which in the Drakengard (video game) example does not even work (the other ones do, but require manual pasting, which is exactly the point about it being broken when multiple Wikidata links exist). -- 205.189.94.9 (talk) 19:58, 25 June 2022 (UTC)
Template pulls URLs from Wikidata that are marked as deprecated
Is there any reason why the template pulls a URL from a Wikidata entry, where the URL on Wikidata is marked as deprecated? We just had an edit request at Elliot Page to remove this template because the URL it was providing was not Elliot's website. Back on 2 June 2022 we had a similar edit request to remove the same URL from Elliot's infobox. At the time I made a request to remove the URL on Wikidata, which they did by marking the field as deprecated. This worked fine for the infobox because it used the {{Official URL}} template, which no longer displays the deprecated URL, but for some reason this template still displays it? Sideswipe9th (talk) 17:43, 15 July 2022 (UTC)
Wrong URL provided despite available URL for English
d:Q828404 has two official websites entered. First one with qualifier "language of work or name" (P407) of "Canadian French" and second one with qualifier of "Canadian English". Listing for Yoho National Park showed the first website, despite there being an entry in English. Deleting the "Canadian French" entry and re-adding resolved the problem, but the problem appears to be that preference is not given if the qualifier is not set to "English" Rosspotter (talk) 07:42, 14 September 2022 (UTC)
Allow pulling links from wikidata from other languages
Sometimes one might want to do something like {{Official website/Archive 4|ru}}
to get an alternate language, could you make it possible? Cardace (talk) 19:32, 30 December 2022 (UTC)