Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Redirect/sandbox/doc
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Main function == The 'main' function of this module accepts the name of a single page. It determines if the page is a redirect; if so it looks up the page, extracts the target, and returns the target name as text. Its usage is <nowiki>{{#invoke:redirect|main|redirect-page-name}}</nowiki>. The template normally neither takes nor gives square brackets, so to show the result as a link use <nowiki>[[{{#invoke:redirect|main|redirect-page-name}}]]</nowiki>. An error is produced if the redirect does not exist, but for versatility no error is given if the file is not a redirect (returns the original text) or if the file name is blank (returns blank). However, if the parameter ''bracket'' is given a nonblank value, brackets will be passed on if present. ===Examples=== ''See [[Module:Redirect/testcases]]'' <nowiki>{{#invoke:redirect|main|WP:AFC}}</nowiki> produces {{#invoke:redirect|main|WP:AFC}} <nowiki>{{#invoke:redirect|main|[[WP:AFD]]|bracket=yes}}</nowiki> produces {{#invoke:redirect|main|[[WP:AFD]]|bracket=yes}} If the target isnt a redirect: <nowiki>{{#invoke:redirect|main|Wikipedia:Articles for deletion|}}</nowiki> produces {{#invoke:redirect|main|Wikipedia:Articles for deletion|}}
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)