Module:Redirect template handler/doc explained

Module:Redirect template handler is used to facilitate editor-friendly redirect template usage. This module is currently used with episode and fictional characters, elements and locations via and .

Usage

The module has two entry points setEpisodeRedirect(args) and setFictionalObjectRedirect(args, objectType).

The functions return a and a boolean value if the redirect is the primary redirect. If an unknown parameter is used, the module also returns a warning about the usage and adds the page to tracking category.

local redirectTemplateHandler = require('Module:Redirect template handler')local redirectCategoryShell, mainRedirect = redirectTemplateHandler.setEpisodeRedirect(args)local redirectCategoryShell, mainRedirect = redirectTemplateHandler.setFictionalObjectRedirect(args, objectType)

Parameter list

ParameterExplanation or
series_nameThe name of the series article, including disambiguation. Will set the value entered as series which this redirect belongs to.--
series_name#For multiple series starting from the 2nd series in the style of . The name of the series article names, including disambiguation. Will set the values entered as series which this object belongs to.--
multi_series_name_tableMultiple series article names, including disambiguation. Will set the values entered as series which this object belongs to. This parameter can only be used from other modules as it requires the parameters to be passed as an args table.--
parent_seriesUsed for scenarios where a series has a short web-based companion series ("minisodes"), and the redirects should be placed in the parent series category.--
restrictedWill tag the redirect with: and set the value entered as the correct title.Yesprintworthy
birth_nameOnly valid for character redirects; Any value will tag the redirect with: .Noprintworthy
alt_nameAny value will tag the redirect with: .Noprintworthy
former_nameAny value will tag the redirect with: .Noprintworthy
short_nameAny value will tag the redirect with: .Noprintworthy
long_nameAny value will tag the redirect with: .Noprintworthy
sort_nameOnly valid for character redirects; Any value will tag the redirect with: . The value must be two characters. See for more information.Noprintworthy
title_nameOnly valid for character redirects; Any value will tag the redirect with: .Nounprintworthy
alt_spellingWill tag the redirect with: and set the value entered as the correct spelling to use.Nounprintworthy
to_diacriticAny value will tag the redirect with: .Nounprintworthy
incorrect_nameAny value will tag the redirect with: and set the value entered as the correct name to use. If isn't used, it will instead use the value entered here.Nounprintworthy
capitalisationAny value will tag the redirect with: and set the value entered as the correct capitalisation to use. If isn't used, it will instead use the value entered here.Nounprintworthy
unneeded_dabAny value will tag the redirect with: .Nounprintworthy
draft_moveAny value will tag the redirect with: and .Nounprintworthy
without_mentionAny value will tag the redirect with: .Nounprintworthy
anchorSet as default for episode redirects. Any value will tag the redirect with: .--
sectionSet as default for fictional character, element and location redirects. Any value will tag the redirect with: .--
listAny value will tag the redirect with: .--
to_articleUsed for redirects to articles, and not to a specific section of the article.--
primaryWill tag the redirect with: and set the value entered as the primary redirect.--
mergeAny value will tag the redirect with: .--
historyAny value will tag the redirect with: .--
dab_exceptionAny value will set the current disambiguation used as correct, regardless if it follows a standard style. See note below.--
correct_disambiguationValue will be used for disambiguation validation. Should be used if the disambiguation is different than the series name, such as when using a franchise name.--
testAny value will set instruct the function to return only testing validation data. Used in /testcases.--
test_titleValue will be used for title validation. Used in /testcases.--

Notes

  • The redirect will automatically be tagged with,,, or depending on the type of redirect, and be placed in the relevant category.
  • Using the series parameters will place the redirect in a series-specific category: <nowiki>[[Category:(series) (object) redirects to lists]]</nowiki>, such as .
  • If the redirect does not use one of the following correct disambiguation — (series), (series) episode, (series) character, (series) element or (series) character — the redirect will be tagged with and .
  • If the redirect is using one of the unprintworthy templates, it will be categorized as . If not, it will be categorized as .
  • If the redirect is using one of the templates marked above as not, it won't be categorized with it.
  • If the redirect is linked to a Wikidata item, it will automatically be tagged with .
  • For episode redirects, a short description will be added only to the primary redirect. Additionally, If (or higher) is used, a short description won't be added.

Tracking category