Template talk:Source

From Wikinews, the free news source you can write!
Jump to navigation Jump to search

Edit request - pub target[edit]

{{edit protected}}


  1. Copy https://en.wikinews.org/w/index.php?title=Template%3ASource%2Fsandbox&type=revision&diff=4519394&oldid=4517961
  2. Protect Template:Source/pub

This change will migrate the handling of linking to the publisher to a new sub template, Template:Source/pub.


  • If no {{{pub|{{{publisher|}}}}}} is provided, no publisher is shown, and no category is added (same as current behaviour)
  • If {{{pub|{{{publisher|}}}}}} is provided, and either no {{{pubtarget|}}} is provided, or the one provided is not equal to none, a link is generated (same as current behaviour)
  • If, and only if, {{{pub|{{{publisher|}}}}}} is provided and the {{{pubtarget}}} parameter is set to none, the published field will not link to the publisher using Template:W. Some publishers simply don't have an article on enwiki, and the link is useless. If the link is disabled, the page will also be added to Category:Articles with source templates without publication links, unless the {{{nocat}}} parameter is provided.

So far, I've found five articles where the publication link should be disabled:

  1. Ayatollah Rafsanjani commemorates Iran-Iraq battle victory, w:Red Bolivia
  2. Freshwater lakes in Texas show signs of extreme drought, w:Disaster News Network
  3. Black spot on Jupiter is impact site, says NASA, w:Jupiter.samba.org
  4. Heavy lift Delta IV rocket launch problems, w:EARTHtimes
  5. Apple introduces new iPod with video playback capabilities, w:The Mac Observer

Using an example from the first article (with the categorization suppressed):


|title=Rafsanjani says Iran's past glories should not be ignored 
|author=Islamic Republic News Agency
|pub=Red Bolivia
|date=May 18, 2007}}



|title=Rafsanjani says Iran's past glories should not be ignored 
|author=Islamic Republic News Agency
|pub=Red Bolivia
|date=May 18, 2007}}

will produce

(and obviously, if the nocat parameter weren't passed, the page would be categorized). The category is provided so that users can check from time to time if an article has been created, and if so remove the pubtarget=none parameter.

Let me know if there are any questions. Pinging Pi zero (t · c · b). Thanks, --DannyS712 (talk) 21:44, 6 October 2019 (UTC)

Also, please ping me once is this implemented (or declined) - I have another feature to add --DannyS712 (talk) 00:54, 12 October 2019 (UTC)
@DannyS712: Well... I did deploy this. Two notes, though.
  • I changed the subtemplate to use no instead of none. It's not too late to change, of course. But in all the cases I recall where we've had a field specifying a link with a non-blank special value to suppress the link, the special value has been no, and it seemed like a good idea to use the same convention everywhere. (The ones I can think of atm are on {{topic cat}}.)
  • I'm glad there's a tracking cat; I'm not entirely sure whether this is a good idea, as there's a certain logic in insisting on a link and thus strongly motivating folks to find a suitable target.
--Pi zero (talk) 14:26, 21 October 2019 (UTC)
@Pi zero: thanks - can you apply the |pubtarget=no parameter to the 5 sources listed about where the publisher doesn't have an article? Thanks, --DannyS712 (talk) 17:30, 21 October 2019 (UTC)
Yeah, I did those five. And yet I still feel we're missing something here, some reason why perhaps we shouldn't be delinking these. (Well, if there is a reason, or something subtly different we should be doing, we've now got the infrastructure for it.) --Pi zero (talk) 18:55, 21 October 2019 (UTC)
I've isolated the no case in {{source/pub/no}}, and for the moment I've got it wired to link despite the request not to. It just doesn't feel right to not link those, like we're cutting ourselves off from things; a diminishing of situational awareness, the opposite of what we should be striving for. We've always managed in the past; but, it's wired now so we can request no-link, and the handling of such requests can be adjusted (in whatever way we can imagine) without affecting articles that don't make such a request. --Pi zero (talk) 17:15, 6 November 2019 (UTC)

Edit request - cleanup[edit]

{{edit protected}}

Please copy this edit made to Template:Source/sandbox2. The results (testcases) can be seen at Template talk:Source/sandbox2; there is no difference to the functionality or output of the template. The change simply removes 2 extra template calls (1 to the `if` parser function, and 1 to the `author` parameter) by combining the two parts that depend on if an author is provided.

Ping @Pi zero: can you take a look? Unlike the request above, this change makes the template less complicated, and has no effect on the template's result, so it should be pretty easy to examine. Thanks, --DannyS712 (talk) 03:53, 17 October 2019 (UTC)

Done. --Pi zero (talk) 15:11, 21 October 2019 (UTC)

Edit request - parser function cleanup[edit]

{{edit protected}}

Please copy Special:Diff/4524098 from the sandbox. This replace

{{#ifeq:{{NAMESPACE}}|Template||{{#if:{{{url|}}}{{{nocat|}}}||[[Category:Articles with broken source templates]]}}}}


{{#if:{{{url|}}}{{{nocat|}}}||{{#ifeq:{{NAMESPACE}}|Template||[[Category:Articles with broken source templates]]}}}}

which functions to switch the order of checks. Since it is far more likely that a url (or a nocat) parameter will be provided than that the template will be used in template space, it reduces the number of parser calls needed:

  • Currently: If not in template space, then check if parameters are passed, then add the category
  • New: If parameters are not passed, then check namespace, then add the category

There should be no functional change in the template's output. @Pi zero: can you take a look? Thanks, --DannyS712 (talk) 17:35, 21 October 2019 (UTC)

Done. --Pi zero (talk) 19:11, 21 October 2019 (UTC)

Edit request - subscription required[edit]

{{edit protected}} Please


Current: {{{subscription}}} parameter doesn't exist

New: If {{{subscription}}} is provided, and it equals "required", a new sub-template, Template:Source/subscription, is transcluded.

The sub template's output is just: Template:Source/subscription

The creation of a separate sub-template, however, rather than implementing this within the source template itself, is to mirror the point of Template:Source/fixauthor - to also create a way to track the use of the parameter - only articles that cite sources that require subscriptions will transclude the sub-template.

Test cases are available at Template talk:Source/sandbox - most of the examples was taken from a currently published article, demonstrating the variety of methods that "subscription required" was conveyed - this will also serve to standardize the practice.

@Pi zero: can you take a look? Thanks, --DannyS712 (talk) 18:09, 23 October 2019 (UTC)

@DannyS712: I don't think we should do this, because we don't want to support subscription-only sources. All of those articles are extremely ancient; we have had an explicit policy against pay-to-read sources for a very, very long time. --Pi zero (talk) 01:23, 24 October 2019 (UTC)
I understand that that is the current policy, but we should have a (standard) way of noting that a subscription is needed (eg I have cited the NYT, which generally requires one) - including it would also serve as a flag for reviewers that the source is paywalled --DannyS712 (talk) 01:26, 24 October 2019 (UTC)
@DannyS712: We're not talking about some minor technicality here. There should not be a way to indicate this; it's not okay, and we must not imply otherwise. --Pi zero (talk) 01:39, 24 October 2019 (UTC)
Okay --DannyS712 (talk) 01:41, 24 October 2019 (UTC)
Not done withdrawn --DannyS712 (talk) 02:27, 24 October 2019 (UTC)