Template talk:Urltowiki
Add topicLinks that don't work
[edit]{{u2w|https://www.mediawiki.org/wiki/Extension:Scribunto/Parser_interface_design#Parent_frame_access}}→ mw:Extension:Scribunto/Parser interface design#Parent frame access{{u2w|Talk:List_of_sovereign_states#Bangsamoro_Republik}}→ Talk:List of sovereign states#Bangsamoro Republik- Now
fixed. — Mr. Stradivarius ♪ talk ♪ 04:16, 23 September 2013 (UTC)
- Now
Remove redundant piped text
[edit]Currently {{subst:urltowiki|https://en.wikipedia.org/wiki/Example|Example}} results in [[Example|Example]], which is redundant and confusing. It seems like it would be easy for the module to check if the display and page title are the same, and if so, only include the page title. I think it would entail switching line 188 from
if display then
to
if display and display ~= wikitext then
(I would add it myself, but I'm not confident in my Lua skills.) Thanks, /~huesatlum/ 15:09, 27 July 2015 (UTC)
- @HueSatLum: Very good point! I've fixed it. — Mr. Stradivarius ♪ talk ♪ 08:29, 28 July 2015 (UTC)
error=no?
[edit]@Ahecht: When would error=no ever be useful or desirable? Jackmcbarn (talk) 17:54, 28 August 2015 (UTC)
- I was just thinking the same thing. Ahecht, what is your use-case here? I'm guessing that there's probably an easier way of doing whatever you're trying to do. — Mr. Stradivarius ♪ talk ♪ 20:22, 28 August 2015 (UTC)
- @Jackmcbarn: The template already gracefully handles other input options, either a valid URL or a non-URL string, so this lets it gracefully handle a missing input if desired. This is similar to the
|ignore_errors=1parameter in module:String. One example where it came in handy is in {{Request redirect/post}}, where I want a blank input to result in a blank output. I could add a statement such as{{safesubst<noinclude/>:#if{{{input|}}}|{{safesubst<noinclude/>:u2w|{{{input}}}}}|}}, but it seemed cleaner this way. I suppose, for consistences sake, I should've usedignore_errors=1instead oferror=no(I can change it if you like) --Ahecht (TALK
PAGE) 04:19, 29 August 2015 (UTC)- If you're accessing Module:UrlToWiki from a Lua module, then you can just use
pcallrather than having to change the module itself.#iferrorwill work from templates as well, although the page will be categorised into Category:Pages with script errors. To avoid the categorisation when calling it from wikitext, we could add another function to the module that is routed throughpcall. That would at least avoid the need for if/then blocks to check for errors. — Mr. Stradivarius ♪ talk ♪ 07:24, 29 August 2015 (UTC)- Since the template is being substituted rather than transcluded in that use case, the page won't end up in Category:Pages with script errors no matter what, so no extra logic for that will be needed. Jackmcbarn (talk) 16:01, 29 August 2015 (UTC)
- If you're accessing Module:UrlToWiki from a Lua module, then you can just use
Requested move 30 October 2019
[edit]- The following is a closed discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. Editors desiring to contest the closing decision should consider a move review after discussing it on the closer's talk page. No further edits should be made to this discussion.
The result of the move request was: Moved (closed by non-admin page mover) Wug·a·po·des 05:04, 8 November 2019 (UTC)
– Match name with template. * Pppery * it has begun... 21:57, 30 October 2019 (UTC)
- Comment: If we are already moving the module, then both should follow WP:TPN and move to "Url to wiki". --Gonnym (talk) 07:26, 31 October 2019 (UTC)
- Fine with me. * Pppery * it has begun... 11:32, 31 October 2019 (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 or in a move review. No further edits should be made to this section.
For whatever reason, diffs are displayed in the mobile interface not using the regular diff but via this special page. Can this template support it, for the benefit of mobile users? Hairy Dude (talk) 20:51, 29 December 2022 (UTC)
Wikilinktourl
[edit]Hello, Mr. Stradivarius. I need the reverse operation, namely convert wikilink to url. (The reason is because of sister projects like Serbian or Chinese Wikipedia that have two or more scripts and the difference is expressed in the query string. For example, Serbian has Latin and Cyrillic scripts, expressed as &variant=sh-latn and &variant=sh-cyrl in the url, so I need the url so I can append the param and link the right one. See this discussion.) I know how to code this in a template, but I thought I'd check with you in case your module already has bits that could be exported and make it trivial by invoking it. Otherwise, I'll just code the whole thing as a template. Thanks, Mathglot (talk) 04:36, 6 December 2025 (UTC)
- P.S. I'm thinking of requiring legitimate wikipedia variant values, so using a #switch to verify and grab the values, and dumping some kind of big red error in the default case if it doesn't match one of the known good values. But I'd like to maintain some consistency with however you've done this template, so if you have a different approach you'd prefer, then please lmk. Mathglot (talk) 05:08, 6 December 2025 (UTC)
- @Mathglot: I don't think there's anything you could use in this module straight away, but you might want to check out Module:Delink which does some parsing of wikilinks. The data at Module:InterwikiTable might also be of use. — Mr. Stradivarius ♪ talk ♪ 14:52, 13 December 2025 (UTC)