Template:NationDataNameRedirect/doc: Difference between revisions

From Terra Invicta Official Wiki
Llamageddon (talk | contribs)
Created page with "<pre>{{NationDataNameRedirect}}</pre> {{NationDataNameRedirect}}"
 
Llamageddon (talk | contribs)
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<pre>{{NationDataNameRedirect}}</pre>
This template is intended for use alongside the <code>subst:</code> magic word, to help with quickly generating multiple nation redirect pages.


{{NationDataNameRedirect}}
== Parameters ==
This template expects a single positional parameter (1).
 
== Usage ==
This template will search the array at [[Module:NationNamer/dataNames]] for a nation/union name that matches parameter 1 and return the equivalent three-letter country code and output a <code>#REDIRECT</code> string with that code as the redirect target page.
 
If no match is found, it will output the string "No such nation name".
 
Expected redirect page syntax is expected, and the <code>subst:</code> magic word is required to ensure a correct redirect link is generated. Missing/incorrect use of <code>subst:</code> will either simply add text to a page, or create a numbered list from the link.
 
== Examples ==
To create a redirect based on the current page title:
 
<pre>{{subst:NationDataNameRedirect|{{subst:PAGENAME}}}}</pre>
 
 
To create a redirect to the nation "Aceh":
 
<pre>{{subst:NationDataNameRedirect|Aceh}}</pre>
 
=== Unexpected/alternative usage examples ===
Incorrect redirect page syntax would result in a numbered list:
#REDIRECT [[ACE]]
 
 
Without the <code>subst:</code> magic word, it will simply output the template link as text:
 
<pre>{{NationDataNameRedirect|Aceh}}</pre>
 
{{NationDataNameRedirect|Aceh}}
 
 
If no nation name matches parameter 1:
 
No such nation name

Latest revision as of 10:27, 13 December 2025

This template is intended for use alongside the subst: magic word, to help with quickly generating multiple nation redirect pages.

Parameters

This template expects a single positional parameter (1).

Usage

This template will search the array at Module:NationNamer/dataNames for a nation/union name that matches parameter 1 and return the equivalent three-letter country code and output a #REDIRECT string with that code as the redirect target page.

If no match is found, it will output the string "No such nation name".

Expected redirect page syntax is expected, and the subst: magic word is required to ensure a correct redirect link is generated. Missing/incorrect use of subst: will either simply add text to a page, or create a numbered list from the link.

Examples

To create a redirect based on the current page title:

{{subst:NationDataNameRedirect|{{subst:PAGENAME}}}}


To create a redirect to the nation "Aceh":

{{subst:NationDataNameRedirect|Aceh}}

Unexpected/alternative usage examples

Incorrect redirect page syntax would result in a numbered list:

  1. REDIRECT ACE


Without the subst: magic word, it will simply output the template link as text:

{{NationDataNameRedirect|Aceh}}

{{subst:#invoke:NationNamer|Redirect|Aceh}}


If no nation name matches parameter 1:

No such nation name