Difference between revisions of "Template:No redirect"

From Second Life Wiki
Jump to navigation Jump to search
(Shamelessly copied from wikipedia.org)
 
m (Move to an older, pre-Lua version of this template on Wikipedia)
 
Line 1: Line 1:
{{safesubst:<noinclude/>#if: {{safesubst:<noinclude/>#invoke:Redirect|isRedirect|{{{1}}}}}
{{{{{|safesubst:}}}#ifexist:{{{1}}}
| <span class="plainlinks">[{{safesubst:<noinclude/>fullurl:{{{1}}}|redirect=no}} {{{2|{{{1}}}}}}]</span>
|<span class="plainlinks">[{{{{{|safesubst:}}}fullurl:{{{1}}}|redirect=no}} {{{2|{{{1}}}}}}]</span>
| {{safesubst:<noinclude/>#if:{{{2|}}}|[[:{{safesubst:<noinclude/>FULLPAGENAME:{{{1}}}}}|{{{2}}}]]|[[:{{safesubst:<noinclude/>FULLPAGENAME:{{{1}}}}}]]}}
|{{{{{|safesubst:}}}#if:{{{2|}}}
  |[[:{{{1}}}|{{{2}}}]]
  |[[:{{{1}}}]]
}}
}}<noinclude>
}}<noinclude>
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>

Latest revision as of 13:51, 2 February 2023

[[:{{{1}}}]]

[Edit] [🔄Purge] Template-info.png Template documentation

Usage

This template provides an easy way to link a redirect page without following the redirect.

{{no redirect|page name|label}}

It accepts two unnamed parameters:

  • 1= (required) the name of the page to link.
  • 2= (optional) the text to be displayed. If this is omitted then the input of the first parameter is used.

Example

Instead of having to copy/paste or type:

  • [https://en.wikipedia.org/w/index.php?title=The_Silence_of_the_Sea&redirect=no ''The Silence of the Sea'']

an editor can type:

  • ''{{No redirect|The Silence of the Sea}}''

or an alias can be used, as in:

  • ''{{-r|The Silence of the Sea}}''

Both of those will take users directly to the same redirect page and display its pagename as a bluelink thus (using the alias): The Silence of the Sea.

The second parameter (label) may be useful in discussions on talk pages. For example,

  • {{-r|The Silence of the Sea|this redirect}}

may appear on a talk page in this context: "For reference, see this redirect."

If there is no page with that name given by the first parameter, the template generates a redlink as for any article name:

Also, if a page is not a redirect, a normal link is displayed:

TemplateData

This is the "Wikipedia logo"TemplateData for this template used by TemplateWizard, "Wikipedia logo"VisualEditor and other tools. Click here to see a monthly parameter usage report for this template based on this TemplateData.

TemplateData for No redirect

{
	"params": {
		"1": {
			"label": "Page name",
			"description": "The name of the page to link",
			"type": "string",
			"required": true
		},
		"2": {
			"label": "Label",
			"description": "The text to be displayed. If this is omitted then the input of the first parameter, page name, is used.",
			"type": "string"
		}
	},
	"description": "This template provides an easy way to link a redirect page without following the redirect."
}

See also