Difference between revisions of "Template:HadezUtilFamilyLinks/doc"

From BattleMaster Wiki
Jump to navigation Jump to search
(Added usage for numeric parameters.)
m
Line 5: Line 5:
 
Optionally the template can be told not to link to a specific family or character (to suppress 'self-links', see below).
 
Optionally the template can be told not to link to a specific family or character (to suppress 'self-links', see below).
  
Assumes family sub-page will be at FAMILY_NAME Family<br>
+
Assumes family sub-page will be at 'FAMILY_NAME Family'<br>
Assumes character sub-page will be at FAMILY_NAME Family/CHARACTER_NAME
+
Assumes character sub-page will be at 'FAMILY_NAME Family/CHARACTER_NAME'
  
 
The template can be called using named or numeric parameters.
 
The template can be called using named or numeric parameters.
 +
 +
Author: [[User:Wraith0x29a|Wraith0x29a]]
  
 
===Parameters===
 
===Parameters===
  
<b>family</b> or param 1 - (required) - character's family name as given in the game.<br>
+
<b>family</b> or param #1 - (required) - character family name as given in the game.<br>
<b>char</b> or param 2 - (required) - character's name as given in the game.<br>
+
<b>char</b> or param #2 - (required) - character name as given in the game.<br>
<b>suppress_family</b> or param 3- (optional) - do not link to family page even if it exists.<br>
+
<b>suppress_family</b> or param #3- (optional) - family name, do not link to family page even if it exists.<br>
<b>suppress_char</b> or param 4 - (optional) - do not link to character page even if it exists.<br>
+
<b>suppress_char</b> or param #4 - (optional) - character name, do not link to character page even if it exists.<br>
  
  
Line 22: Line 24:
 
<b>Using Named Parameters</b>
 
<b>Using Named Parameters</b>
  
<nowiki>{{HadezUtilFamilyLinks
+
<nowiki>{{HadezUtilFamilyLinks</nowiki><br>
|char=CHARACTER_NAME
+
<nowiki>| char=CHARACTER_NAME</nowiki><br>
|family=FAMILY_NAME
+
<nowiki>| family=FAMILY_NAME</nowiki><br>
}}</nowiki>
+
<nowiki>}}</nowiki>
  
 
Shows the text CHARACTER_NAME FAMILY_NAME.<br>
 
Shows the text CHARACTER_NAME FAMILY_NAME.<br>
Line 31: Line 33:
 
If a character page named 'FAMILY_NAME Family/CHARACTER NAME' exists links CHARACTER_NAME to that page.
 
If a character page named 'FAMILY_NAME Family/CHARACTER NAME' exists links CHARACTER_NAME to that page.
  
<nowiki>{{HadezUtilFamilyLinks
+
<nowiki>{{HadezUtilFamilyLinks</nowiki><br>
|family=FAMILY_NAME_TO_SUPPRESS
+
<nowiki>| family=FAMILY_NAME_TO_SUPPRESS</nowiki><br>
|char=CHARACTER_NAME
+
<nowiki>| char=CHARACTER_NAME</nowiki><br>
|suppress_char=CHARACTER_NAME_TO_SUPPRESS
+
<nowiki>| suppress_char=CHARACTER_NAME_TO_SUPPRESS</nowiki><br>
}}</nowiki>
+
<nowiki>}}</nowiki>
  
 
As above but even if a family page for FAMILY_NAME_TO_SUPPRESS or character page for CHARACTER_NAME_TO_SUPPRESS exists does not link to it.
 
As above but even if a family page for FAMILY_NAME_TO_SUPPRESS or character page for CHARACTER_NAME_TO_SUPPRESS exists does not link to it.
Line 41: Line 43:
 
This is mainly used where this utility template is used from another template for dynamically generated lists on family or character pages (like lists of other families/characters in a character's realm). It is used to suppress 'self-links' where the link would be to the page that the output of this template is ultimately displayed on. Self-links are put in bold text by the wiki engine which is ugly IMHO.  
 
This is mainly used where this utility template is used from another template for dynamically generated lists on family or character pages (like lists of other families/characters in a character's realm). It is used to suppress 'self-links' where the link would be to the page that the output of this template is ultimately displayed on. Self-links are put in bold text by the wiki engine which is ugly IMHO.  
  
You can use
 
  
 
<b>Using Numeric Parameters</b>
 
<b>Using Numeric Parameters</b>
  
<nowiki>{{HadezUtilFamilyLinks|CHARACTER_NAME|FAMILY_NAME|FAMILY_NAME_TO_SUPPRESS|CHARACTER_NAME_TO_SUPPRESS}}</nowiki>
+
<nowiki>{{HadezUtilFamilyLinks|FAMILY_NAME|CHARACTER_NAME}}</nowiki>
 +
 
 +
<nowiki>{{HadezUtilFamilyLinks|FAMILY_NAME|CHARACTER_NAME|FAMILY_NAME_TO_SUPPRESS|CHARACTER_NAME_TO_SUPPRESS}}</nowiki>
  
 
If omitting FAMILY_NAME_TO_SUPPRESS remember to provide a blank value for it..
 
If omitting FAMILY_NAME_TO_SUPPRESS remember to provide a blank value for it..
  
 
<nowiki>{{HadezUtilFamilyLinks|CHARACTER_NAME|FAMILY_NAME||CHARACTER_NAME_TO_SUPPRESS}}</nowiki>
 
<nowiki>{{HadezUtilFamilyLinks|CHARACTER_NAME|FAMILY_NAME||CHARACTER_NAME_TO_SUPPRESS}}</nowiki>
 +
 +
You can also mix up the order of numeric parameters so long as you specify the parameter numbers..
 +
 +
<nowiki>{{HadezUtilFamilyLinks|3=FAMILY_NAME_TO_SUPPRESS|2=CHARACTER_NAME|4=CHARACTER_NAME_TO_SUPPRESS|1=FAMILY_NAME}}</nowiki>

Revision as of 00:50, 5 December 2009

Summary

A utility template - shows a character name with links to family page and character sub-page if those pages exist.

Optionally the template can be told not to link to a specific family or character (to suppress 'self-links', see below).

Assumes family sub-page will be at 'FAMILY_NAME Family'
Assumes character sub-page will be at 'FAMILY_NAME Family/CHARACTER_NAME'

The template can be called using named or numeric parameters.

Author: Wraith0x29a

Parameters

family or param #1 - (required) - character family name as given in the game.
char or param #2 - (required) - character name as given in the game.
suppress_family or param #3- (optional) - family name, do not link to family page even if it exists.
suppress_char or param #4 - (optional) - character name, do not link to character page even if it exists.


Usage

Using Named Parameters

{{HadezUtilFamilyLinks
| char=CHARACTER_NAME
| family=FAMILY_NAME
}}

Shows the text CHARACTER_NAME FAMILY_NAME.
If a family page named 'FAMILY_NAME Family' exists links FAMILY_NAME to that page.
If a character page named 'FAMILY_NAME Family/CHARACTER NAME' exists links CHARACTER_NAME to that page.

{{HadezUtilFamilyLinks
| family=FAMILY_NAME_TO_SUPPRESS
| char=CHARACTER_NAME
| suppress_char=CHARACTER_NAME_TO_SUPPRESS
}}

As above but even if a family page for FAMILY_NAME_TO_SUPPRESS or character page for CHARACTER_NAME_TO_SUPPRESS exists does not link to it.

This is mainly used where this utility template is used from another template for dynamically generated lists on family or character pages (like lists of other families/characters in a character's realm). It is used to suppress 'self-links' where the link would be to the page that the output of this template is ultimately displayed on. Self-links are put in bold text by the wiki engine which is ugly IMHO.


Using Numeric Parameters

{{HadezUtilFamilyLinks|FAMILY_NAME|CHARACTER_NAME}}

{{HadezUtilFamilyLinks|FAMILY_NAME|CHARACTER_NAME|FAMILY_NAME_TO_SUPPRESS|CHARACTER_NAME_TO_SUPPRESS}}

If omitting FAMILY_NAME_TO_SUPPRESS remember to provide a blank value for it..

{{HadezUtilFamilyLinks|CHARACTER_NAME|FAMILY_NAME||CHARACTER_NAME_TO_SUPPRESS}}

You can also mix up the order of numeric parameters so long as you specify the parameter numbers..

{{HadezUtilFamilyLinks|3=FAMILY_NAME_TO_SUPPRESS|2=CHARACTER_NAME|4=CHARACTER_NAME_TO_SUPPRESS|1=FAMILY_NAME}}