Warning
This is an unofficial archive of PsychonautWiki as of 2025-08-11T15:14:44Z. Content on this page may be outdated, incomplete, or inaccurate. Please refer to the original page for the most up-to-date information.

Template:Template shortcut/doc: Difference between revisions

From PsychonautWiki Archive
Jump to navigation Jump to search
>PJosepherum
m 1 revision
>Kenan
m Update documentation of template shortcut base
 
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
{{tsh|tsh}}
{{tsh|tsh}}
{{high-use}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
This template shows shortcuts (= redirects) to a template, like the box appearing at the right. {{tl|Tsh}} is a shortcut to {{<nowiki />template shortcut}}.
This template displays one or more of a template's shortcuts (that is, redirects, also known as aliases, as in the box appearing at the right. {{tl|Tsh}} is a shortcut to this template, {{<nowiki />template shortcut}}, and can be used in its place, as it is in this documentation's [[Wikipedia:View source|source]] [[wikitext]].


== Usage ==
== Usage ==
===Which to show?===
Place this template and its list of few to one, carefully selected shortcut(s) at the top of the template documentation page's [[Wikipedia:Wikitext|wikitext]], right underneath {{tl|Documentation subpage}}. In the saved, rendered text, those shortcuts will appear in this template's Shortcut(s) box, whose title will reflect the number of list items by automatically being singular or plural in form.  
Although the template can show up to ten aliases, editors are ''encouraged to choose well'' which ones to display. Even if many redirects exist, ''two or three at the most'' is almost always enough, and by keeping the number small, it facilitates remembering them, and the situation is kept well organized.  


List others in the "aliases" section of the [[Wikipedia:Template documentation|template documentation]]. Again, not all of them need to be listed; some shortcuts are there just for historical reasons, and others differ only in whitespaces or in capitalization. Such names are usually better to hide.
===Which ones to display here===
Although the template can show up to ten shortcuts, you are ''encouraged to choose well'' which ones to display in this template's box. Even if many redirects exist, ''two or three at the most'' is almost always enough. By keeping the number of redirects presented in the Shortcut box small, it makes it easier to remember them, and the documentation is kept well organized.  


Place this template at the top of the template documentation page.
===Where to list any others===
List others in the Redirects section of the [[Wikipedia:Template documentation|template documentation]]. Again, not all of them need to be listed; some shortcuts are there just for historical reasons, and others differ only in minor points such as white spaces or capitalization. Such shortcut-name variations are unnecessary to list at all—just list the standard, most common version of such a variation.


===Optional parameters===
===Optional parameters===
This template has several optional parameters:
This template has several optional parameters:
* '''float''' – if set to "left", then the box will float to the left of the page, instead of the default float "right".
* '''float''' – if set to "left", then the box will float to the left of the page, instead of the default float "right".
* '''pre, pre2, pre3 ... up to pre10''' – can be used to show some text before the shortcut links, but within the braces. This is mostly used to indicate that the template should be used with substitution.  
* '''clear''' – if set to "right" (when float also is set to "right"), the box will be pushed to the right margin of the page, and {{clarify|text=prevent it from nest to the left of other right-floating elements.}}  Similarly, if set to "left" (when float also is set to "left"), the box will be pushed to the left margin of the page.
* '''pre, pre2, pre3 ... up to pre10''' – can be used to show some text before the shortcut links, but within the braces. This is mostly used to add the text "subst:". This shows the proper syntax for using the template with [[Wikipedia:Substitution|substitution]].  


==Examples==
:As with the other shortcuts in the saved, rendered version of this template, this shortcut code can be copied from its line in the box on the documentation page, as it is, and pasted in the [[wikitext]] of another page where you wish its rendered version to appear.
===Basic===
* '''top''' – to change the padding above the box (e.g. {{para|top|0}} for no padding, {{para|top|0.2em}}, {{para|top|4}}{{\}}{{para|top|4px}}).
For one template shortcut named {{tl|uw-v1}}:  
 
==Examples of basic code==
 
To display one template shortcut named {{tl|uw-v1}}:  


{{tlc|template shortcut|uw-v1}}
{{tlc|template shortcut|uw-v1}}
Line 25: Line 31:
{{clear}}
{{clear}}


To indicate that {{tl|uw-vandalism1}} has three shortcuts named: {{tl|uw-v1}}, {{tl|uw-vand1}}, and {{tl|uw-vandal1}}; then the following code may be used:
To display three template shortcuts for {{tl|uw-vandalism1}} named {{tl|uw-v1}}, {{tl|uw-vand1}}, and {{tl|uw-vandal1}}:


{{tlc|template shortcut|uw-v1|uw-vand1|uw-vandal1}}
{{tlc|template shortcut|uw-v1|uw-vand1|uw-vandal1}}
Line 31: Line 37:
{{clear}}
{{clear}}


=== With additional parameters ===
==Example with the float parameter==
Using {{para|float|<var>left</var>}} makes this template flow to the left of the page:
Using {{para|float|<var>left</var>}} makes this template flow to the left of the page:


Line 38: Line 44:
{{clear}}
{{clear}}


Using {{para|pre2|<var>subst:</var>}} and {{para|pre3|<var>subst:</var>}} will show "subst:" before the shortcut links, but within the braces. For example:  
==Example with text ("subst:") within the braces==
This is mostly used to add text to show how the template could be used with [[Wikipedia:Substitution|substitution]].
 
Use {{para|pre2|<var>subst:</var>}} and {{para|pre3|<var>subst:</var>}} to show "subst:" before the shortcut links, but within the braces:  


<code><nowiki>{{template shortcut|uw-v1|pre2=subst:|uw-vand1|pre3=subst:|uw-vandal1}}</nowiki></code>
<code><nowiki>{{template shortcut|uw-v1|pre2=subst:|uw-vand1|pre3=subst:|uw-vandal1}}</nowiki></code>
Line 45: Line 54:


== See also ==
== See also ==
* {{tl|policy shortcut}} – for shortcuts to sections of policy pages
* {{tl|shortcut}}, the standard shortcut notice.
* {{tl|shortcut}} – the normal shortcut
** {{tl|shortcut-l}} for a left-aligned standard shortcut notice.
* {{tl|shortcut-l}} for left aligned normal shortcuts
* {{tl|policy shortcut}} for shortcuts to sections of policy pages.


<includeonly>
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
<!----CATEGORIES BELOW THIS LINE, PLEASE:---->
[[Category:Disambiguation and redirection templates]]
[[Category:Disambiguation and redirection templates]]
[[Category:Template documentation]]
[[Category:Template documentation]]
 
}}</includeonly>
</includeonly>

Latest revision as of 00:44, 10 July 2017

This template displays one or more of a template's shortcuts (that is, redirects, also known as aliases, as in the box appearing at the right. {{Tsh}} is a shortcut to this template, {{template shortcut}}, and can be used in its place, as it is in this documentation's source wikitext.

Usage

Place this template and its list of few to one, carefully selected shortcut(s) at the top of the template documentation page's wikitext, right underneath {{Documentation subpage}}. In the saved, rendered text, those shortcuts will appear in this template's Shortcut(s) box, whose title will reflect the number of list items by automatically being singular or plural in form.

Which ones to display here

Although the template can show up to ten shortcuts, you are encouraged to choose well which ones to display in this template's box. Even if many redirects exist, two or three at the most is almost always enough. By keeping the number of redirects presented in the Shortcut box small, it makes it easier to remember them, and the documentation is kept well organized.

Where to list any others

List others in the Redirects section of the template documentation. Again, not all of them need to be listed; some shortcuts are there just for historical reasons, and others differ only in minor points such as white spaces or capitalization. Such shortcut-name variations are unnecessary to list at all—just list the standard, most common version of such a variation.

Optional parameters

This template has several optional parameters:

  • float – if set to "left", then the box will float to the left of the page, instead of the default float "right".
  • clear – if set to "right" (when float also is set to "right"), the box will be pushed to the right margin of the page, and [clarification needed] Similarly, if set to "left" (when float also is set to "left"), the box will be pushed to the left margin of the page.
  • pre, pre2, pre3 ... up to pre10 – can be used to show some text before the shortcut links, but within the braces. This is mostly used to add the text "subst:". This shows the proper syntax for using the template with substitution.
As with the other shortcuts in the saved, rendered version of this template, this shortcut code can be copied from its line in the box on the documentation page, as it is, and pasted in the wikitext of another page where you wish its rendered version to appear.
  • top – to change the padding above the box (e.g. |top=0 for no padding, |top=0.2em, |top=4 / |top=4px).

Examples of basic code

To display one template shortcut named {{uw-v1}}:

{{template shortcut|uw-v1}}

To display 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

Using |float=left makes this template flow to the left of the page:

{{template shortcut|float=left|uw-v1}}

Example with text ("subst:") within the braces

This is mostly used to add text to show how the template could be used with substitution.

Use |pre2=subst: and |pre3=subst: to show "subst:" before the shortcut links, but within the braces:

{{template shortcut|uw-v1|pre2=subst:|uw-vand1|pre3=subst:|uw-vandal1}}

See also

  • {{shortcut}}, the standard shortcut notice.
    • {{shortcut-l}} for a left-aligned standard shortcut notice.
  • {{policy shortcut}} for shortcuts to sections of policy pages.