Template:Shortcut

From Team Fortress Wiki
Revision as of 06:46, 5 August 2021 by Darkid (talk | contribs) (Copying MediaWiki's Shortcut template (from before it became a module))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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.