Template:Template shortcut/doc
| This is a documentation subpage for Template:Template shortcut It contains usage information, categories and other content that is not part of the original template page. |
| This template is used on many pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
| This template uses Lua: |
This template dey show one or more shortcuts for a template (meaning redirects, also called aliases, like the box wey dey show for the right side. {{Tsh}} be shortcut for this template, {{template shortcut}}, and you fit use am instead, just like e dey used for this documentation's source wikitext.
Usage
[edit source]Put this template and the small list of selected shortcut(s) wey you want to show for top of the template documentation page's wikitext, right under {{Documentation subpage}}. For the saved and displayed text, the shortcuts go show inside this template's Shortcut(s) box. The title of the box go automatically change between singular and plural depending on the number of items for the list.
Which ones to display here
[edit source]Even though this template fit show up to ten shortcuts, you dey encouraged to choose carefully which ones you put inside this template's box. Even if plenty redirects dey exist, two or three maximum almost always enough. When you keep the number of redirects small inside the Shortcut box, e go make them easier to remember and keep the documentation organized.
Where to list any others
[edit source]Put other ones inside the Redirects section of the template documentation. Again, no be all of them need to dey listed; some shortcuts dey there only because of old reasons, and others differ only small small, like spaces or capital letters. These kind shortcut-name variations no need listing—just list the normal and most common version.
Optional parameters
[edit source]This template get some optional parameters:
- float – if you set am to "left", the box go float for left side of the page instead of the default "right".
- clear – if you set am to "right" (when float also dey set to "right"), the box go move to the right edge of the page, and stop am from joining to the left side of other right-floating things.[clarification needed] Same way, if you set am to "left" (when float also dey "left"), the box go move to the left edge of the page.
- pre – you fit use am to show some text before the shortcut links but inside the braces. People mostly use am to add "subst:". This show the correct way to use the template with substitution.
- pre1, pre2 ... – same like above, but the prefix only add to the nth shortcut.
Examples of basic code
[edit source]To show one template shortcut named {{uw-v1}}:
{{template shortcut|uw-v1}}
To show three template shortcuts for {{uw-vandalism1}} named {{uw-v1}}, {{uw-vand1}}, and {{uw-vandal1}}:
{{template shortcut|uw-v1|uw-vand1|uw-vandal1}}
Example with the float parameter
[edit source]Using |float=left make this template move to the left side of the page:
{{template shortcut|float=left|uw-v1}}
Example with text ("subst:") within the braces
[edit source]People mostly use this to add text showing how the template fit work with substitution.
Use |pre2=subst: and |pre3=subst: to show "subst:" before the shortcut links, but still inside the braces:
{{template shortcut|uw-v1|pre2=subst:|uw-vand1|pre3=subst:|uw-vandal1}}
If you use |pre=subst:, e go apply to all the shortcuts:
{{template shortcut|pre=subst:|uw-v1|uw-vand1|uw-vandal1}}
TemplateData
[edit source]Related pages
[edit source]- {{shortcut}}, the normal shortcut notice.
- {{policy shortcut}}, for shortcuts to sections of policy pages.
- {{R to redirect template}}, the rcat template for redirects to rcat templates
- {{template redirect}}, automatically sets
redirect=yes