🇮🇷 Iran Proxy | https://www.wikipedia.org/wiki/Template_talk:Official_URL
Jump to content

Template talk:Official URL

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

"no value" and end dates

[edit]

The template should filter out outdated sites, those with an end date, and take into account that "no value" as preferred rank is also used to indicate that the company has no website anymore.

This is (should be) doable with the {{Wikidata}} template that is used here, I guess, at least through the advanced commands ? TomT0m (talk) 19:06, 18 January 2024 (UTC)[reply]

This is a list of articles this could concern if they have the template : https://w.wiki/8tov for companies only. 130 articles, although I don’t check if they actually have the template. TomT0m (talk) 15:06, 19 January 2024 (UTC)[reply]

The redirect Template:OURL has been listed at redirects for discussion to determine whether its use and function meets the redirect guidelines. Readers of this page are welcome to comment on this redirect at Wikipedia:Redirects for discussion/Log/2024 August 16 § Template:OURL until a consensus is reached. — GhostInTheMachine talk to me 18:00, 16 August 2024 (UTC)[reply]

Optional URL override

[edit]

I added an optional parameter to the sandbox version for an URL, which will override the Wikidata input. While I prefer linking to WD, maybe this option can be useful where a different official URL is needed than the default WD value, or where the infobox is for a different entity than the article topic (e.g. there may be a secondary infobox). This will make this template similar to the regular {{URL}} template, while still displaying nothing if both are empty (no error message). -- P 1 9 9   15:37, 2 December 2024 (UTC)[reply]

 Not done The entire point of this template is to display the URL from Wikidata. If you don't want that then don't use the template (just use {{URL}} instead). * Pppery * it has begun... 17:34, 2 December 2024 (UTC)[reply]

Refactor of this to use Module:official website

[edit]

Facepalm Facepalm @Gonnym: and that is why I did a TFD instead of just redirecting... Thank you and thanks for providing me a link to an example, SUPER helpful! So new idea... What do you think of refactoring this so that it uses a new function in the same module (Module:Official website). That way we get the same tracking category and error catching, while (and this is critical) maintaining the same display effect of showing the URL instead of either "Official website" or a custom URL text supplied by either |2= or |name=. Zackmann (Talk to me/What I been doing) 16:05, 21 November 2025 (UTC)[reply]

I haven't checked the codes of the template and module to see why they are different, but if there is no reason for the difference, then I agree that both should have the same error tracking. Gonnym (talk) 18:51, 21 November 2025 (UTC)[reply]
@Gonnym: so I've got it mostly figured out at Module:Official website/sandbox & {{Official URL/sandbox}}. The one thing I can't decide is should this use the same tracking category or should be implement a new one? Also, currently if there is no website on Wikidata {{Official website}} displays an error message while {{Official URL}} does not (see below). Should we change that?
  • {{Official URL}}
  • {{Official website}}No URL found. Please specify a URL here or add one to Wikidata.
What are your thoughts? Zackmann (Talk to me/What I been doing) 00:23, 22 November 2025 (UTC)[reply]
Update so what I decided to do is to keep the old behavior. {{Official URL}} will still not display an error message (this would result in error messages popping up all over the place if I suddenly added this functionality).
What I opted to do instead was to insert a {{preview warning}} that says Preview warning: No official website (P856) found in wikidata. Nothing will be displayed. Since there will not be an error message displayed, I opted not to create a tracking category for pages that use {{Official URL}} but don't have a valid value to display. That can easily be changed if people think it would be helpful to have. How does that sound to everyone?
@Gonnym, Jonesey95, and Hike395: can I impose on you all to review the changes I have made in Module:Official website/sandbox and {{Official URL/sandbox}} to see if they are safe to merge in? Because of the nature of this making a call to wikidata, it is very difficult to test in the traditional manner with testcases. It currently doesn't accept a qid being passed in and that would be an even larger refactor. I have done my testing in my sandbox and by inserting the code onto live pages and previewing the results. Definitely want a second and third set of eyes on this before I merge it.
Thanks in advance! Zackmann (Talk to me/What I been doing) 06:50, 22 November 2025 (UTC)[reply]
The preview error sounds like a good idea. Gonnym (talk) 13:13, 25 November 2025 (UTC)[reply]
The testcases should really have testcases as anything else makes it extreamly hard to validate. At Module:Official_website#L-90 is where we get the qid. You could refactor to allow a test_qid there. Gonnym (talk) 13:16, 25 November 2025 (UTC)[reply]
I am going to attempt to take a mini wikibreak for Thanksgiving, but will tackle this when I get back. Zackmann (Talk to me/What I been doing) 16:26, 25 November 2025 (UTC)[reply]
@Gonnym: So about that wikibreak.... Anyway, refactor wasn't as complicated as I thought it would be. The 3 failures at Module:Official website/testcases are all expected failures as they all rely on the new code in Module:Official website/sandbox. The results that the sandbox produces in those cases is what I would expect to see.
I STILL want to have someone else test this ({{Official URL/sandbox}}) on a live page (which I have as well) to confirm it works as expected since in the testcases I can only test the case of manually supplying |qid=, not the case of inheriting the QID from the page itself. As far as I know, there is no way to test that in Module:UnitTests. Zackmann (Talk to me/What I been doing) 05:18, 26 November 2025 (UTC)[reply]