Template:Xref: Difference between revisions

From EPOD
(Created page with "<includeonly> ''' {{{Type}}} {{{Ref}}}''': {{{Text|}}} </includeonly> <noinclude> == Usage == The following includes the text passed to the template. The example shows how this ...")
 
m (1 revision imported)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>
<includeonly>
''' {{{Type}}} {{{Ref}}}''': {{{Text|}}}
'''{{{Type}}} {{{Num}}}''': ''{{{Text|}}}''
</includeonly>
</includeonly><noinclude>
<noinclude>
== Usage ==
== Usage ==


The following includes the text passed to the template. The example shows how this may be used within an document template. If not, replace the parameters with literals.  
The following includes the type, number and text passed to the template. The example shows how this may be used within an document template. If not, replace the parameters with literals.  
  <nowiki>
  <nowiki>
{{#vardefine:Example|0}}
{{#vardefine:Example|0}}
{{Xref
{{Xref
|ExampleNo={{ #vardefineecho: Example | {{ #expr: {{ #var: Example }} + 1 }} }}
|Num={{ #vardefineecho: Example | {{ #expr: {{ #var: Example }} + 1 }} }}
|Text=The text describing the cross-reference
|Text=The text describing the cross-reference
}}</nowiki>  
}}</nowiki>  
Line 20: Line 19:


[[Category:Templates|{{PAGENAME}}]]
[[Category:Templates|{{PAGENAME}}]]
</noinclude>
<templatedata>
{
"params": {
"Type": {
"aliases": [
"1"
],
"label": "Type",
"description": "The cross reference type e.g. Example, Table, etc",
"type": "string",
"required": true
},
"Num": {
"aliases": [
"2"
],
"label": "Num",
"description": "The cross-reference number",
"type": "number",
"required": true
},
"Text": {
"aliases": [
"3"
],
"label": "Text",
"description": "The text to describe the cross reference.",
"type": "string",
"required": true
}
},
"description": "The following includes the type, number and text passed to the template. The example shows how this may be used within an document template. If not, replace the parameters with literals. \n <nowiki>\n{{#vardefine:Example|0}}\n{{Xref\n|Num={{ #vardefineecho: Example | {{ #expr: {{ #var: Example }} + 1 }} }}\n|Text=The text describing the cross-reference\n}}</nowiki> "
}
</templatedata></noinclude>

Latest revision as of 10:25, 28 August 2024

Usage

The following includes the type, number and text passed to the template. The example shows how this may be used within an document template. If not, replace the parameters with literals.

{{#vardefine:Example|0}}
{{Xref
|Num={{ #vardefineecho: Example | {{ #expr: {{ #var: Example }} + 1 }} }}
|Text=The text describing the cross-reference
}} 


Example 1: The text describing the cross-reference

The following includes the type, number and text passed to the template. The example shows how this may be used within an document template. If not, replace the parameters with literals. <nowiki> {{#vardefine:Example|0}} {{Xref |Num={{ #vardefineecho: Example | {{ #expr: {{ #var: Example }} + 1 }} }} |Text=The text describing the cross-reference }}</nowiki>

Template parameters

ParameterDescriptionTypeStatus
TypeType 1

The cross reference type e.g. Example, Table, etc

Stringrequired
NumNum 2

The cross-reference number

Numberrequired
TextText 3

The text to describe the cross reference.

Stringrequired