Template:Citation core

From PoliticalSG
Revision as of 20:18, 14 July 2026 by SGPolitico (talk | contribs)

Usage

Shared core for this wiki's Lua-free citation templates (Template:Cite web, Template:Cite news, Template:Cite journal, Template:Cite AV media, Template:citation). Not meant to be called directly on content pages — use one of those instead.

Built because upstream Citation Style 1/2 templates run on Module:Citation/CS1, which requires Scribunto/Lua — unavailable on this wiki (the same proc_open block that rules out

Citation core

's original Lua version). This reimplementation covers the field set actually used across Politicalsg articles rather than CS1's full parameter surface, and delegates the author/title/work formatting to three small helper subtemplates (Template:Citation core/author, Template:Citation core/title, Template:Citation core/work) so both the CS1 and CS2 branches below share the same logic.

Deviations from upstream CS1/CS2 — read before assuming parity:

  • Supported fields: last, first, last2, first2, date, year, title, type, url, work/website/journal, publisher, language, pages/page, isbn, issn, access-date, archive-url, archive-date, url-status, via, quote. No editor, volume, issue, doi, id, ref, display-authors, trans-title, or the many other CS1 fields. Extend this template (and thread the field through the relevant wrapper) if a page needs one of these.
  • No automatic error messages for malformed input (missing title, url without title, etc.) — upstream shows visible red warnings; this version just renders oddly.
  • mode= selects formatting: mode=citation gives comma-separated CS2-style output, lowercase "archived"/"retrieved", no trailing terminal period. Any other value (web, news, journal, avmedia) gives period-separated CS1-style output. mode=avmedia additionally italicises the title instead of quoting it.
  • Dead-link handling is simplified: if url-status=dead and archive-url= is given, the title links to the archive copy and "the original" is shown unlinked in the archive note. Matches upstream's basic behaviour but not every edge case (url-status=usurped, |df= date-format normalisation are not handled).
  • Only one primary author (last/first) plus one secondary (last2/first2) — no last3+ chaining, no display-authors=etal.