Difference between revisions of "Template:HadezUtilFamilyLinks/doc"

From BattleMaster Wiki
Jump to navigation Jump to search
m
(Added usage for numeric parameters.)
Line 3: Line 3:
 
A utility template - shows a character name with links to family page and character sub-page if those pages exist.
 
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<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.
 +
 +
===Parameters===
 +
 +
<b>family</b> or param 1 - (required) - character's 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>suppress_family</b> or param 3- (optional) - 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>
 +
  
 
===Usage===
 
===Usage===
  
<nowiki>{{HadezUtilFamilyLinks|char=CHARACTER_NAME|family=FAMILY_NAME}}</nowiki>
+
<b>Using Named Parameters</b>
 +
 
 +
<nowiki>{{HadezUtilFamilyLinks
 +
|char=CHARACTER_NAME
 +
|family=FAMILY_NAME
 +
}}</nowiki>
  
 
Shows the text CHARACTER_NAME FAMILY_NAME.<br>
 
Shows the text CHARACTER_NAME FAMILY_NAME.<br>
Line 13: Line 31:
 
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|char=CHARACTER_NAME|family=FAMILY_NAME|suppress_char=CHARACTER_NAME}}</nowiki>
+
<nowiki>{{HadezUtilFamilyLinks
 +
|family=FAMILY_NAME_TO_SUPPRESS
 +
|char=CHARACTER_NAME
 +
|suppress_char=CHARACTER_NAME_TO_SUPPRESS
 +
}}</nowiki>
  
As above but even if a character page 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.
This is mainly to suppress 'self-links' where the link would be to the page the template is ultimately included on in which case the wiki would remove the link and bold the text which is ugly.
+
 +
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.  
  
===Parameters===
+
You can use
 +
 
 +
<b>Using Numeric Parameters</b>
 +
 
 +
<nowiki>{{HadezUtilFamilyLinks|CHARACTER_NAME|FAMILY_NAME|FAMILY_NAME_TO_SUPPRESS|CHARACTER_NAME_TO_SUPPRESS}}</nowiki>
 +
 
 +
If omitting FAMILY_NAME_TO_SUPPRESS remember to provide a blank value for it..
  
char - (required) - character's name as given in the game.<br>
+
<nowiki>{{HadezUtilFamilyLinks|CHARACTER_NAME|FAMILY_NAME||CHARACTER_NAME_TO_SUPPRESS}}</nowiki>
family - (required) - character's family name as given in the game.<br>
 
suppress_char - (optional) - do not link to character page even if it exists.<br>
 
suppress_family - (optional) - do not link to family page even if it exists.<br>
 

Revision as of 00:17, 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.

Parameters

family or param 1 - (required) - character's family name as given in the game.
char or param 2 - (required) - character's name as given in the game.
suppress_family or param 3- (optional) - do not link to family page even if it exists.
suppress_char or param 4 - (optional) - 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.

You can use

Using Numeric Parameters

{{HadezUtilFamilyLinks|CHARACTER_NAME|FAMILY_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}}