Jump to content

Template:Wikisource/doc

From Wikipedia, the free encyclopedia

This is a versatile template which links to a source at one of our sister projects, Wikisource.

The default behaviour of this template is to present a string "English Wikisource has original text related to this article:" with a link to a page on Wikisource with the same name as the Wikipedia page. Its behavior can be modified in the following ways:

Full example:

{{Wikisource|<link target>|<link display>|lang=<lang code>|has=<text to introduce the link>|nocat=yes to disable categorization|italics=yes to display the source in italics}}

[edit]

To modify the link target, include the name of the document at Wikisource as the first parameter:

{{Wikisource|Magna Carta}}

produces:

Modifying the display text

[edit]

The second parameter is the display text:

{{Wikisource|The Velveteen Rabbit#9|Name for The Velveteen Rabbit}}

produces:

Linking to another language's Wikisource

[edit]

To link to another language's Wikisource, you can either use the |lang= parameter, or you can put the language before the source links.

{{Wikisource|la|Magna Carta|Magna Carta in Latin}}

and

{{Wikisource|Magna Carta|Magna Carta in Latin|lang=la}}

both produce:

Modifying the introductory text

[edit]

The |has= parameter overrides the text following the word "has" introductory text text: {{Wikisource|Magna Carta|has=the full text of the Magna Carta}}

produces:

Works by or about something

[edit]

The |works= parameter has four values, all of which indicate that the source at Wikisource is by or about the subject matter. It can be set to any case-insensitive version of:

  • by
  • about
  • both
  • or (discouraged; please be specific about what text is present at Wikisource)

If given anything else, the parameter is ignored. The parameter has no effect if |has= is provided (see § Modifying the introductory text)

For example, {{Wikisource|Author:Marcus Tullius Cicero|Cicero|works=both|nocat=yes}} produces:

Wikidata

[edit]

If the template is not given a link target, it will attempt to find an interwiki link from Wikidata. If no Wikidata link is found, it will search Wikisource for the Wikipedia article's title.

Categorisation

[edit]

If no Wikidata link is found, the template will populate Category:Wikisource templates with missing id (7,988). If the lack of interwiki link is intentional, add |nocat=yes.

Pages using {{wikisource}} with unknown parameters are sorted into Category:Pages using Wikisource with unknown parameters (111). This is not turned off with |nocat=yes.

TemplateData

[edit]
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Wikisource in articles based on its TemplateData.

TemplateData for Wikisource

No description.

Template parameters

ParameterDescriptionTypeStatus
Language codelang

The ISO 639 code of the Wikisource language. "mul" indicates the Multilingual Wikisource.

Suggested values
mul es la fr de
Default
en
Example
es
Lineoptional
Link target1

The link target, without any Wikisource: or language prefix

Example
Magna Carta
Linesuggested
Display text2

The link's display text

Default
The link target
Example
Full text of the Magna Carta
Lineoptional
Has text replacementhas

The text following "Wikisource has" ...

Default
text related to this article
Example
the full text of the Magna Carta
Lineoptional
Works byworks

This parameter indicates that the content at Wikisource is by/about the subject, rather than a copy of the subject. Can be set to "by", "about", or "both", or "or", depending on what type of content is present at Wikisource.

Suggested values
by about both or
Lineoptional
positionposition

If set to "left", displays the box floats to the left

Suggested values
left
Lineoptional
nocatnocat

If true, disables categorisation in [[Category:Wikisource templates with missing id]]. This is useful if the omission of a sitelink at Wikidata is intentional.

Default
false
Booleanoptional
italicsitalic italics

If true, displays the source in italics

Default
false
Booleanoptional
Run diagnosticsdiagnose

If true, displays some diagnostic information. Useful for debugging.

Booleanoptional

See also

[edit]