Difference between revisions of "Template:Shortcut"

From Team Fortress Wiki
Jump to: navigation, search
m (Add left float because we might need it soon)
m (Should hopefully fix this page being in the category without affecting the template itself, changed link to link to the WP:SHORTCUT rather than the Wikipedia page for shortcuts)
Line 4: Line 4:
 
<table class="shortcutbox noprint" style="float: {{{float|right}}}; border: 1px solid #aaa; background: #fff; margin: .3em .3em .3em 1em; padding: 3px; text-align: center;"><tr><th style="border: none; background: transparent;" class="plainlist"><!--
 
<table class="shortcutbox noprint" style="float: {{{float|right}}}; border: 1px solid #aaa; background: #fff; margin: .3em .3em .3em 1em; padding: 3px; text-align: center;"><tr><th style="border: none; background: transparent;" class="plainlist"><!--
 
Adding the shortcut links:
 
Adding the shortcut links:
--><small>[[w:Shortcut|Shortcut{{#if:{{{2|}}}|s}}]]:
+
--><small>[[w:WP:Shortcut|Shortcut{{#if:{{{2|}}}|s}}]]:
 
   {{#if:{{{1|}}}|<ul><li> [[{{{1}}}]]</li>
 
   {{#if:{{{1|}}}|<ul><li> [[{{{1}}}]]</li>
 
}}{{#if:{{{2|}}}|<li> [[{{{2}}}]]</li>
 
}}{{#if:{{{2|}}}|<li> [[{{{2}}}]]</li>
Line 21: Line 21:
 
| {{#ifexist:{{{1|}}}
 
| {{#ifexist:{{{1|}}}
 
   |  
 
   |  
   | [[Category:Wikipedia shortcut box first parameter needs fixing|{{PAGENAME}}]]
+
   | [[<noinclude>:</noinclude>Category:Wikipedia shortcut box first parameter needs fixing|{{PAGENAME}}]]
 
   }}
 
   }}
 
}}<noinclude>
 
}}<noinclude>

Revision as of 18:21, 5 February 2023

Shortcut:

Template documentation [view] [edit] [history] [purge]

A shortcut template is similar to the {{anchor}} template, but it adds a visual box graphic to the rendered page, as well as providing an alternative name. Creating a redirect page is a requirement to fulfill the shortcut mechanism.

Usage

This template is not normally used for articles in the main namespace, because the graphic produces an avoidable self-reference.

  1. Insert the shortcut template.
  2. Create a redirect page. Name the page after your shortcut name. Include the namespace name in both the shortcut name and the redirect page name. For example, substitute your own shortcut name as the title of the page, and substitute the proper namespace, then add the following as the top-line on your redirect page:
    #REDIRECT [[''Namespace'':''Title of page with''#''Optional very long section name'']]
  3. Verify operation. Note that shortcut templates should display in all capitals, but operate without all capitals.
Notes

These templates are mainly used on user pages and talk pages in reference to the TFW namespace. These templates inform about the shortcuts available to the page they are on. For example, w:SHORT redirects to w:Wikipedia:Shortcut and therefore, Wikipedia:Shortcut renders a shortcut box listing WP:SHORT. It is a self-reference that is normally avoided in the main article namespace.

The point of these templates is not to list every single redirect for a page (indeed, that's what "What links here" is for). Instead, they should list only one or two common and easily-remembered redirects.

The shortcut template can take up to ten (10) shortcuts as parameters.

Examples

Code Result
{{Shortcut|W:WP:SHORT}}
Shortcut:
{{Shortcut|W:WP:V|W:WP:VERIFY|W:WP:SOURCE}}
Shortcuts:

Anchors

These templates automatically add anchors. If a shortcut box with the shortcut w:WP:SHORT is placed on the page w:Wikipedia:Shortcut, then the link w:Wikipedia:Shortcut#WP:SHORT will take you to the position in the page where that shortcut box is placed.

Thus, if you make a shortcut for a section of a page, then you can use the anchor in the shortcut redirect itself. Like this:

#REDIRECT [[Pagename#WP:SHORT]]

See also

  • w:Shortcut – The how-to guide and guideline about how and when to create shortcuts and shortcut boxes. A must-read for anyone handling shortcuts.