Module talk:WikidataIB/Archive 7: Difference between revisions

Content deleted Content added
m Replaced deprecated <source> tags with <syntaxhighlight> (via WP:JWB)
Fix Linter errors.
 
Line 507:
<pre>{{#invoke:WikidataIB|url2|url={{url|https://www.portoftyne.co.uk/about-us/history/heritage-sites/heritage-sites}}}}</pre>
::produces
<span><!--span tag inserted here October 2022 to prevent spurious Linter error-->{{#invoke:WikidataIB|url2|url={{url|https://www.portoftyne.co.uk/about-us/history/heritage-sites/heritage-sites}}}}
::which is what we were seeing on [[Swing Bridge, River Tyne]]. I believe it is quite common for this template to be used in infoboxes, so unless there is a reliable way of detecting it, I could not use url2 in the way I was previously. Would it be better if only the value from wikidata were put through url2, and the fallback value just displayed raw? &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 21:05, 26 November 2020 (UTC)
::: {{re|MSGJ}} I finally remembered what I'd been doing. The call to ur2 in WikidataIB was the prototype for an alternative function that I developed in [[Module:URL]]. I recommend using [[Template:URL2]]. It uses a lot of the code used by {{t|url}} but doesn't give error messages with a nil input (useful for Wikidata) and can take the output of {{tl|url}} as its input if an editor uses that as the local parameter.