Template:Counterparts/doc: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
(Created page with "'''{{tlx|Counterparts}}''' is a template used to construct "alternate counterparts of..." boxes that go below infoboxes. It's syntax is simple: <pre>{{counterparts|name=page name of primary counterpart|dname=display name of primary counterpart|1=first counterpart|d1=display name of second counterpart|2=second counterpart|d2=display name of second counterpart}}</pre> By default, the name of the primary counterpart used in the box's header is the...")
 
m (killer work as always Bongo!)
Tag: 2017 source edit
Line 1: Line 1:
'''{{tlx|Counterparts}}''' is a template used to construct "alternate counterparts of..." boxes that go below [[:Category:Infoboxes|infoboxes]]. It's syntax is simple:
'''{{tlx|Counterparts}}''' is a template used to construct "alternate counterparts of..." boxes that go below [[:Category:Infoboxes|infoboxes]]. It's syntax is simple:


<pre>{{counterparts|name=page name of primary counterpart|dname=display name of primary counterpart|1=first counterpart|d1=display name of second counterpart|2=second counterpart|d2=display name of second counterpart}}</pre>
<pre>{{counterparts |name=page name of primary counterpart
|dname=display name of primary counterpart
|1=first counterpart |d1=display name of second counterpart
|2=second counterpart |d2=display name of second counterpart}}</pre>


By default, the name of the primary counterpart used in the box's header is the page name of the page the template is being used on. If that is not desirable, it can optionally be specified using the name variable. This produces a link to the specified page with the display text set to the name specified but without the dab term. If a different display name should be used, that can be specified with the optional dname variable.
By default, the name of the primary counterpart used in the box's header is the page name of the page the template is being used on. If that is not desirable, it can optionally be specified using the name variable. This produces a link to the specified page with the display text set to the name specified but without the dab term. If a different display name should be used, that can be specified with the optional dname variable.


Counterparts are specified with numbered variables like 1 and 2. Technically, the actual "1=" bit can be omitted. However, that quickly becomes confusing when combining it with the display name variables. By default, the counterpart's dab term is used as display text. If there is no dab term, the full page name is used. If neither of these are desirable, a display name can be manually set using an optional "d" variable. For instance, if you want to specify the display name for the third counterpart, you would use the d3 variable.  
Counterparts are specified with numbered variables like 1 and 2. Technically, the actual "1=" bit can be omitted. However, that quickly becomes confusing when combining it with the display name variables. By default, the counterpart's dab term is used as display text. If there is no dab term, the full page name is used. If neither of these are desirable, a display name can be manually set using an optional "d" variable. For instance, if you want to specify the display name for the third counterpart, you would use the d3 variable.


In theory, the template supports infinitely many counterparts, although there is a practical limit after which performance would begin to noticeably suffer.  
In theory, the template supports infinitely many counterparts, although there is a practical limit after which performance would begin to noticeably suffer.


== Example ==
== Example ==
{{counterparts|name=Twelfth Doctor|1=Twelfth Doctor|d1=The Doctor's universe|2=Twelfth Doctor (Shadow World)|3=Twelfth Doctor (The Curse of Fatal Death)|d3=''The Curse of Fatal Death''|4=Twelfth Doctor (Four Doctors)|d4=''Four Doctors''}}
{{counterparts |name=Twelfth Doctor
|1=Twelfth Doctor |d1=The Doctor's universe
|2=Twelfth Doctor (Shadow World)
|3=Twelfth Doctor (The Curse of Fatal Death) |d3=''The Curse of Fatal Death''
|4=Twelfth Doctor (Four Doctors) |d4=''Four Doctors''}}


The following code produces the box on the right:
The following code produces the box on the right:


<pre>{{counterparts|name=Twelfth Doctor|1=Twelfth Doctor|d1=The Doctor's universe|2=Twelfth Doctor (Shadow World)|3=Twelfth Doctor (The Curse of Fatal Death)|d3=''The Curse of Fatal Death''|4=Twelfth Doctor (Four Doctors)|d4=''Four Doctors''}}</pre>
<pre>{{counterparts |name=Twelfth Doctor
|1=Twelfth Doctor |d1=The Doctor's universe
|2=Twelfth Doctor (Shadow World)
|3=Twelfth Doctor (The Curse of Fatal Death) |d3=''The Curse of Fatal Death''
|4=Twelfth Doctor (Four Doctors) |d4=''Four Doctors''}}</pre>

Revision as of 13:19, 24 June 2022

{{Counterparts}} is a template used to construct "alternate counterparts of..." boxes that go below infoboxes. It's syntax is simple:

{{counterparts |name=page name of primary counterpart
|dname=display name of primary counterpart
|1=first counterpart |d1=display name of second counterpart
|2=second counterpart |d2=display name of second counterpart}}

By default, the name of the primary counterpart used in the box's header is the page name of the page the template is being used on. If that is not desirable, it can optionally be specified using the name variable. This produces a link to the specified page with the display text set to the name specified but without the dab term. If a different display name should be used, that can be specified with the optional dname variable.

Counterparts are specified with numbered variables like 1 and 2. Technically, the actual "1=" bit can be omitted. However, that quickly becomes confusing when combining it with the display name variables. By default, the counterpart's dab term is used as display text. If there is no dab term, the full page name is used. If neither of these are desirable, a display name can be manually set using an optional "d" variable. For instance, if you want to specify the display name for the third counterpart, you would use the d3 variable.

In theory, the template supports infinitely many counterparts, although there is a practical limit after which performance would begin to noticeably suffer.

Example

The following code produces the box on the right:

{{counterparts |name=Twelfth Doctor
|1=Twelfth Doctor |d1=The Doctor's universe
|2=Twelfth Doctor (Shadow World)
|3=Twelfth Doctor (The Curse of Fatal Death) |d3=''The Curse of Fatal Death''
|4=Twelfth Doctor (Four Doctors) |d4=''Four Doctors''}}