Difference between revisions of "Template:Shortcut/doc"
(Adapted doc from the wiki template at time of copy.) |
m |
||
Line 6: | Line 6: | ||
# Insert the shortcut template. | # Insert the shortcut template. | ||
# 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: | # 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: | ||
− | #:<nowiki>#REDIRECT [[ | + | #:<nowiki>#REDIRECT [[''Namespace'':''Title of page with''#''Optional very long section name'']]</nowiki> |
# Verify operation. Note that shortcut templates should display in all capitals, but operate without all capitals. | # Verify operation. Note that shortcut templates should display in all capitals, but operate without all capitals. | ||
Revision as of 21:32, 3 September 2022
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.
Contents
Usage
This template is not normally used for articles in the main namespace, because the graphic produces an avoidable self-reference.
- Insert the shortcut template.
- 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'']]
- 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|WP:SHORT}}
|
|
{{Shortcut|WP:V|WP:VERIFY|WP:SOURCE}}
|
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.