Difference between revisions of "Template:Crossreference/doc"

From blackwiki
Jump to navigation Jump to search
(spacing)
imported>Vanisaac
m (clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other)
 
(10 intermediate revisions by 6 users not shown)
Line 3: Line 3:
 
{{lua|Module:Hatnote inline}}
 
{{lua|Module:Hatnote inline}}
  
The {{tl|Crossreference}} template formats text into a standardized style for an {{em|inline}} (not block-level) "''(See also ...)''"-type parenthetical [[MOS:CROSSREF|Wikipedia crossreference]] to other Wikipedia material. When on the different pages, these are [[WP:SELFREF|unprintworthy Wikipedia self-references]].  When crossreferencing material on the same page, they are not. For block-level crossreferences, see the {{tl|Hatnote}} meta-template and its many progeny ({{tl|See also}}, etc.). The output is ultimately produced by [[Module:Hatnote inline]].  
+
The {{tlx|crossreference}} (a.k.a. {{tlx|crossref}} or {{tlx|xref}}) template formats text into a standardized style for an {{em|inline}} (not block-level) "''(See also ...)''"-type parenthetical [[MOS:CROSSREF|Wikipedia crossreference]] to other Wikipedia material. When on different pages, these are [[WP:SELFREF|unprintworthy Wikipedia self-references]].  When crossreferencing material on the same page, they are not. For block-level crossreferences, see the {{tlx|Hatnote}} meta-template and its various progeny ({{tlx|See also}}, etc.). The output is ultimately produced by [[Module:Hatnote inline]].  
  
 
See [[:Category:Cross-reference templates]] for other templates derived from or similar to this template.
 
See [[:Category:Cross-reference templates]] for other templates derived from or similar to this template.
Line 9: Line 9:
 
== Usage ==
 
== Usage ==
  
; Basic crossreference to another page:
+
'''Basic crossreference to another page:'''
{{tlx|Crossreference|(See also [<nowiki />[Radical Whigs]].)}}
+
{{markup|<nowiki>{{Crossreference|(See also [[Radical Whigs]].)}}</nowiki>|
 +
{{Crossreference|(See also [[Radical Whigs]].)}}}}
  
; Basic crossreference on same page:
+
'''Basic crossreference on same page:'''
{{tlx|Crossreference|selfref{{=}}no|(see [<nowiki />[#Parameters]])}}
+
{{markup|<nowiki>{{Crossreference|selfref=no|(see [[#Parameters]])}}</nowiki>|
 +
{{Crossreference|selfref=no|(see [[#Parameters]])}}}}
  
; All parameters:
+
'''All parameters:'''
{{tlx|Crossreference|{{var|text}}|class{{=}}{{var|class1 class2}}|selfref{{=}}no}}
+
{{markup|<nowiki>{{Crossreference|text|class=class1 class2|selfref=no}}}}</nowiki>|
 +
{{Crossreference|text|class=class1 class2|selfref=no}}}}
  
 
The meta-template does not automatically create links of any kind. Links and other desired formatting (round brackets, terminal punctuation) must be explicitly added, using normal [[Wikipedia:Cheatsheet|Wikipedia markup]].
 
The meta-template does not automatically create links of any kind. Links and other desired formatting (round brackets, terminal punctuation) must be explicitly added, using normal [[Wikipedia:Cheatsheet|Wikipedia markup]].
  
Usage for links in the same article is discouraged, in favor of the more specific templates {{tl|See above}} and {{tl|See below}}.
+
<!--DEPRECATED BY AUTHOR; going to replace them: Usage for links in the same article is discouraged, in favor of the more specific templates {{tlx|See above}} and {{tlx|See below}}.-->
  
 
== Parameters ==
 
== Parameters ==
  
 
This template accepts the following parameters:
 
This template accepts the following parameters:
* {{para|1}} or {{para|text}} or {{para|content}} the cross-reference text (required). While the explicit naming of this parameter with <code>1=</code>, <code>text=</code>, or <code>content=</code> is not required, it is always safest to use it this way, since any <code>=</code> character in the text will break the template if the parameter is unnamed.
+
* {{para|1}} or {{para|text}} or {{para|content}} – The cross-reference text (required). While the explicit naming of this parameter with <code>1=</code>, <code>text=</code>, or <code>content=</code> is not required, it is always safest to use it this way, since any <code>=</code> character in the text will break the template if the parameter is unnamed.
* {{para|class}} or {{para|extraclasses}} any extra CSS classes to be added. This should not normally be used.
+
* {{para|class}} or {{para|extraclasses}} – Any extra CSS classes to be added. This should not normally be used.
* {{para|selfref|no}} &ndash; if set to <kbd>no</kbd> (or <kbd>n</kbd>, <kbd>false</kbd>, <kbd>0<kbd>, etc.) removes the default CSS class <code>selfref</code>, used to denote unprintworthy self-references to Wikipedia {{crossref|(see [[Template:Selfref]] for more information)}}. This option should not be used on cross-article links, only links within the same article (and the shorthand templates {{tlx|See above}} and {{tlx|See below}} can be used for this purpose). The parameter alias {{para|printworthy|yes}} (or with any other value, like <kbd>y</kbd>, <kbd>true</kbd>, <kbd>1</kbd>, etc.) has the same effect as {{para|selfref|no}}.
+
* {{para|selfref|no}} – If set to <kbd>no</kbd> (or <kbd>n</kbd>, <kbd>false</kbd>, <kbd>0</kbd>, etc.) removes the default CSS class <code>selfref</code>, used to denote unprintworthy self-references to Wikipedia {{crossref|(see [[Template:Selfref]] for more information)}}. This option should not be used on cross-article links, only links within the same article (and the shorthand templates {{tlx|See above}} and {{tlx|See below}} can be used for this purpose). The parameter aliases {{para|printworthy|yes}} (or with any other value, like <kbd>y</kbd>, <kbd>true</kbd>, <kbd>1</kbd>, etc.) and {{para|unprintworthy|no}} (or <kbd>n</kbd>, <kbd>false</kbd>, <kbd>0</kbd>) have the same effect as {{para|selfref|no}}.
  
 
== Redirects ==
 
== Redirects ==
Line 38: Line 41:
 
== See also ==
 
== See also ==
 
* {{tlx|Hatnote inline}}, for the meta-template this template uses, and other templates that use it
 
* {{tlx|Hatnote inline}}, for the meta-template this template uses, and other templates that use it
* {{tlx|See above}} and {{tlx|See below}}, some specific, printworthy "child" templates of {{tl|Crossreference}}
+
* {{tlx|See above}} and {{tlx|See below}}, some specific, printworthy "child" templates of {{tlx|Crossreference}}
 
* [[Template:Hatnote templates documentation]], for all the block-format hatnotes]]
 
* [[Template:Hatnote templates documentation]], for all the block-format hatnotes]]
  
<includeonly>
+
<includeonly>{{Sandbox other||
 
[[Category:Cross-reference templates|{{PAGENAME}}]]
 
[[Category:Cross-reference templates|{{PAGENAME}}]]
 
[[Category:Inline hatnote templates|{{PAGENAME}}]]
 
[[Category:Inline hatnote templates|{{PAGENAME}}]]
</includeonly>
+
}}</includeonly>
 +
 
 +
== Template data ==
 +
<templatedata>
 +
{
 +
"params": {
 +
"text": {
 +
"aliases": [
 +
"1",
 +
"content"
 +
]
 +
},
 +
"class": {
 +
"aliases": [
 +
"extraclasses"
 +
],
 +
"label": "CSS classes"
 +
},
 +
"printworthy": {
 +
"aliases": [
 +
"selfref"
 +
],
 +
"type": "boolean"
 +
}
 +
},
 +
"description": "formats text into a standardized style for an inline (not block-level) \"(See also ...)\"-type parenthetical Wikipedia crossreference to other Wikipedia material.",
 +
"paramOrder": [
 +
"text",
 +
"class",
 +
"printworthy"
 +
],
 +
"format": "inline"
 +
}
 +
</templatedata>

Latest revision as of 22:16, 24 April 2020

The {{crossreference}} (a.k.a. {{crossref}} or {{xref}}) template formats text into a standardized style for an inline (not block-level) "(See also ...)"-type parenthetical Wikipedia crossreference to other Wikipedia material. When on different pages, these are unprintworthy 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 by Module:Hatnote inline.

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

Usage

Basic crossreference to another page:

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

(See also Radical Whigs.)

Basic crossreference on same page:

Markup Renders as
{{Crossreference|selfref=no|(see [[#Parameters]])}}

(see #Parameters)

All parameters:

Markup Renders as
{{Crossreference|text|class=class1 class2|selfref=no}}}}

text

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


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 to no (or n, false, 0, etc.) removes the default CSS class selfref, used to denote unprintworthy self-references to Wikipedia (see Template:Selfref 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 with any other value, like y, true, 1, etc.) and |unprintworthy=no (or n, false, 0) have the same effect as |selfref=no.

Redirects

The following alternative names redirect to this template:

See also


Template data

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

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Texttext 1 content

no description

Unknownoptional
CSS classesclass extraclasses

no description

Unknownoptional
Printworthyprintworthy selfref

no description

Booleanoptional