Vorlage:News Source/pub/doc

< Vorlage:News Source‎ | pub
Version vom 12. August 2020, 00:46 Uhr von wikinewsen>Pi zero (→‎Internals: new section)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Gnome-emblem-important.svg
Diese Vorlage wird auf over 21,000 Seiten verwendet
Um große Unterbrechungen und unnötige Serverauslastung zu vermeiden, solltest du Änderungen an anderer Stelle testen, indem du beispielsweise den Quellcode dieser Vorlage kopierst und in den Benutzerbereich oder in die Sandbox einfügst. Erwäge, deine Änderungen auf der Diskussionsseite vorzuschlagen, bevor du diese Vorlage bearbeitest.

This template handles the publisher field for {{source}}. Though this is called for every citation, the logic in handling this field is somewhat nontrivial, so factoring out the formatting to here leaves the parent template more purely concerned with sorting out the template fields.

Usage

Three parameters are supported:

  • pub — required — name of the publisher.
  • target — required — target for the link; always provided by the parent template (which is responsible for sorting out the template interface). target=no requests the publisher be left unlinked (see {{source/pub/no}}).
  • nocat — optional — if non-blank, suppresses categorization.

Internals

Don't be tripped up by the parameter names here. They do not correspond, quite, to the names of parameters passed to the parent template, {{source}}. Parameter pub is often, but not always, the same as the same-named parameter to the parent template. Parameter target is sometimes the same as parent parameter pubtarget, but that parent parameter is optional and (as of this writing) usually omitted, whereas the target parameter here is required.