Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Template:Crossreference

Permanently protected template
From Wikipedia, the free encyclopedia
(Redirected fromTemplate:Crossref)

sample content

Template documentation[view] [edit] [history] [purge]
WarningThis template is used onapproximately 2,600 pages and changes may be widely noticed. Test changes in the template's/sandbox or/testcases subpages, or in your ownuser subpage. Consider discussing changes on thetalk page before implementing them.
This template usesLua:
CSSThis template usesTemplateStyles:

The{{Crossreference}} (a.k.a.{{crossref}} or{{xref}}) template formats text into a standardized style for aninline (not block-level) "(See also ...)"-type parentheticalWikipedia crossreference to other Wikipedia material. When on different pages, these areunprintworthy Wikipedia self-references. When crossreferencing material on the same page, they are not. For block-level crossreferences, see the{{Hatnote}} meta-template and its various progeny ({{See also}}, etc.). The output is ultimately produced byModule:Hatnote inline. It actually does support a block-level mode, however, for special cases (see parameter documentation below).

SeeCategory:Cross-reference templates for other templates derived from or similar to this template.

Usage

The template does not automatically create links of any kind. Links and other desired formatting (round brackets, terminal punctuation) must be explicitly added, using normalWikipedia markup.

Basic crossreference to another page:

MarkupRenders as
{{Crossreference|(See also [[Radical Whigs]].)}}

(See alsoRadical Whigs.)

Basic crossreference on same page:

MarkupRenders as
{{Crossreference|selfref=no|(see {{slink|#Parameters}})}}

All parameters:

MarkupRenders as
{{Crossreference|class=class1 class2|selfref=no|inline=no|Blargh:* Foo* Bar* Baz}}
Blargh:
  • Foo
  • Bar
  • Baz

Parameters

This template accepts the following parameters:

  • |1= or|text= or|content= – The cross-reference text (required). While the explicit naming of this parameter with|1=,|text=, or|content= is not required, it is always safest to use it this way, since any= character in the text will break the template if the parameter is unnamed.
  • |class= or|extraclasses= – Any extra CSS classes to be added. This should not normally be used.
  • |selfref=no – If set tono (orn,false,0, etc.), removes the default CSS classselfref, used to denote unprintworthy self-references to Wikipedia(seeTemplate:Self-reference for more information). This option should not be used on cross-article links, only links within the same article (and the shorthand templates{{See above}} and{{See below}} can be used for this purpose). The parameter aliases|printworthy=yes or|pw=yes (also with any other value, likey,true,1, etc.) and|unprintworthy=no (orn,false,0) have the same effect as|selfref=no. This can also be used for cross-references between internal Wikipedia pages such as guidelines and policies; there is no rationale to suppress the printing-out of links in this case. Note: These parameters are not yet "smart", and do not detect opposite values; that is,|printworthy=no and|unprintworthy=yes will not have the desired effect (and would be redundant anyway, since unprintworthiness is the default).
  • |inline= – Defaults toyes. If set tono (orn,false,0, etc.), it will use a<div> element instead of a<span>, so you can use block-level elements inside it, such as a list. The difference between{{Crossreference|inline=no|...}} and{{Hatnote|...}} is that the former is not indented the way the latter is. This de-indentation is done byWP:TemplateStyles, specifically inTemplate:Crossreference/styles.css.

CSS

This template always adds the CSS classcrossreference, so you can useWP:User styles to do as you wish with it. You will need to use!important probably only in the case that you want to override this template's non-indentation when it is in block mode (i.e., when you do want it indented the way{{Hatnote}} works), and you'll be doing this with on-site user style, such asSpecial:MyPage/common.css. This is because TemplateStyles actually load after on-site user styles, so you must override the TemplateStyle with the!important priority flag.

Redirects

The following alternative names redirect to this template:

See also

Template data

This is theTemplateData for this template used byTemplateWizard,VisualEditor and other tools.See a monthly parameter usage report forTemplate:Crossreference in articles based on its TemplateData.

TemplateData for Crossreference

formats text into a standardized style for an inline (not block-level) "(See also ...)"-type parenthetical Wikipedia crossreference to other Wikipedia material.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
texttext1content

no description

Contentrequired
printworthyprintworthyselfref

no description

Booleanoptional
CSS classesclassextraclasses

no description

Unknownoptional
inlineinline

no description

Booleanoptional
The abovedocumentation istranscluded fromTemplate:Crossreference/doc.(edit |history)
Editors can experiment in this template'ssandbox(edit |diff) andtestcases(edit) pages.
Add categories to the/doc subpage.Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Crossreference&oldid=1190790325"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp