Difference between revisions of "Template:Cite web/test"

From DoomWiki.org

(Allow "url" parameter to be an external link template or an interwiki link (i.e. strip off the square brackets if they're single, but not if they're double))
 
(fix order of parameters to #ifeq)
Line 1: Line 1:
<includeonly>{{#tag:ref|{{{author|}}}{{#if:{{{publishdate|}}}|&nbsp;({{#time:j F Y|{{{publishdate}}}}}).|{{#if:{{{author|}}}|.|}}}} {{#if:{{{title|}}}|[{{#ifeq:{{#sub:{{{url}}}|0|1}}|&#91;|{{#ifeq:{{#sub:{{{url}}}|0|2}}|&#91;&#91;|{{#sub:{{{url}}}|1|-1}}|{{{url}}}}}|{{{url}}}}} "{{condfullstop|{{{title}}}}}"]|{{condfullstop|{{{url}}}}}}} {{#if:{{{publication|}}}|''{{{publication}}}.''|}} {{#if:{{{retrievedate|}}}|Retrieved {{#time:j F Y|{{{retrievedate}}}}}.|{{#if:{{{accessdate|}}}|Retrieved {{#time:j F Y|{{{accessdate}}}}}.|}}}}}}</includeonly><noinclude>
+
<includeonly>{{#tag:ref|{{{author|}}}{{#if:{{{publishdate|}}}|&nbsp;({{#time:j F Y|{{{publishdate}}}}}).|{{#if:{{{author|}}}|.|}}}} {{#if:{{{title|}}}|[{{#ifeq:{{#sub:{{{url}}}|0|1}}|&#91;|{{#ifeq:{{#sub:{{{url}}}|0|2}}|&#91;&#91;|{{{url}}}|{{#sub:{{{url}}}|1|-1}}}}|{{{url}}}}} "{{condfullstop|{{{title}}}}}"]|{{condfullstop|{{{url}}}}}}} {{#if:{{{publication|}}}|''{{{publication}}}.''|}} {{#if:{{{retrievedate|}}}|Retrieved {{#time:j F Y|{{{retrievedate}}}}}.|{{#if:{{{accessdate|}}}|Retrieved {{#time:j F Y|{{{accessdate}}}}}.|}}}}}}</includeonly><noinclude>
 
Simple website {{wp|Wikipedia:Citing_sources|citation}} template.
 
Simple website {{wp|Wikipedia:Citing_sources|citation}} template.
 
==Usage==
 
==Usage==

Revision as of 06:23, 7 June 2020

Simple website citation template.

Usage

  • author: Principal author or editor of the work.
  • publishdate: Date article or page was originally published.
  • url: URL of the webpage. Required.
  • title: Title of article. Optional. If provided, this is used as the link text for the provided URL. Quotation marks will be automatically included.
  • publication: Title of publishing site, journal, blog, etc. Optional. If provided, will be automatically italicized.
  • retrievedate: Date article or page was retrieved by the wiki editor. Optional. If included, the text "Retrieved" will appear before the provided date.
  • accessdate: Alternate name for retrievedate.

Note that parameters taking a date will be passed to the {{#time}} parser function, and thus can be in any valid ISO date format, but must be in such a valid format or the following error text will appear: Error: Invalid time. For more information, see the official time function documentation.