FANDOM


|- style="text-align:center;" |style="width:30%; text-align:center;" rowspan="1"|Preceded by
{{{before}}}

Template documentation (for the template shown above, sometimes hidden or invisible)

{{TOC right}} forces the auto-generated Table of Contents for an article to appear floated to the right side of the page, in order to improve article layout.

Usage

Insert {{S-bef}} at the point in the article where you want the top of the Table of Contents box to appear. This should usually be after the text of the lead section, and just before the first section heading, in accordance with Wikipedia:Lead section#Elements of the lead. Use with {{-}} or {{clear}} to prevent collision with text; use the clear parameter (see below) to prevent collision with images.

  • Avoid placing the TOC in a visually poor location. Crossing a section division is probably a poor idea.

Parameters (optional)

clear
Sets the CSS clear property, which forces this float underneath the side specified with this attribute. So, clear=right (which is the default) will place the element after all the right floating elements before it. Options are left, right, both, or none.
width
Set the CSS width.
limit
Limits the depth of subheadings shown. For instance using limit=4 will hide the fourth level and deeper subheadings in the hierarchy. And limit=2 will hide all subheadings leaving only the main headings. This is implemented as a CSS class in the MediaWiki:Common.css.

Cautions

Do not use this template to just force word wrap around the TOC, as this is inappropriate method of achieving this. Instead add a CSS class to your current skin's .css file, which will apply site wide. Go to Special:Mypage/skin.css, which redirects to your current skin's CSS file.

Do not place this template so that the TOC aligns with a large image or infobox; this breaks the layout on narrow screens (even users with screens as wide as 1024px wide can have problems). Also, a TOC that crosses a section division is probably a poor idea, if that can be avoided.

Unless the section in which the {{TOC right}} is placed is long enough, the result may well be undesirable.

It should only be used in cases where the TOC gets in the way of other content or is detrimental to the layout of the page; it should not simply be used for aesthetics since it tampers with the standard appearance of articles. See Help:Section#Floating the TOC for further guidelines.

See also

Usage

{{documentation subpage}}

OR


Userboxes

When used to document usage of a userbox, it may be preferred to have this template state "userbox"/"userbox page" instead of "template"/"template page" or "user template"/"user template page". If this is preferred, use:

{{userbox documentation subpage}}

OR


Customization of text

To manually change the text of the template, the "text1=your text here" and/or "text2=your other text here" parameters can be specified. "text1=" changes the automatic text on the first line to your own word(s). "text2=" changes the automatic text on the second line to your own word(s). If "text1=" parameter is specified without the "text2=" parameter, both the first and second line of text will be custom based on the text given in the "text1=" parameter.

Example usage:




How it is displayed

This template should be placed at the top of "/doc" pages. It changes output depending on where it is viewed:

  • On a "/doc" page, it displays a box explaining template documentation and links to the template page.
  • On other pages (ie, pages transcluding the "/doc" page), the template will not show. The template page itself (which contains {{Documentation}}) will automatically note that the documentation is transcluded from a subpage.

Functions

In addition to the output message, the template categorizes pages to Category:Template documentation pages, Category:User documentation pages, or similar (named after the subject space), but only for documentation pages in namespaces with the subpage feature. It defaults the sort key to the page name without namespace (ie, "Foo" on "Template:Foo", so it would be sorted in categories under 'F').

See also

General information about documentation for templates:

{{Documentation}} family:

Meta-Wiki {{Documentation}} ancestor:


This template is used similarly to {{tl}}, to show the name of a template with the open and close braces around it. But this macro makes the inner braces part of the link, whereas {{tl}} does not make the braces part of the link. This is to allow shorter template names to be easier to click on. The "Tn" name is short for Template name.

Usage

{{tn|name}}

It will render this:

{{name}}

Compare with:

{{tl|name}}

Which renders this:

{{name}}

See also

There are several similar templates, these two lists most of them with some examples:

Template linking templatesScript error
Link Style Linked Unlinked Linked with subst: Linked including braces Linked with alternative text
Text Style option --
​nolink[[:Template:=]]yes​
​subst[[:Template:=]]yes​
​braceinside[[:Template:=]]yes​
​alttext[[:Template:=]]FOO​
Normal -- , ; ,
Teletype
​tt[[:Template:=]]yes​
Bold
​bold[[:Template:=]]yes​
Bold Teletype
​bold[[:Template:=]]yes|tt[[:Template:=]]yes​
Italic Teletype
​italic[[:Template:=]]yes|tt[[:Template:=]]yes​
code2
​code2[[:Template:=]]yes​
NOTE: is the most general, allowing any combination of the above options.
da:Skabelon:Tn

ja:Template:Tn pt:Predefinição:Tn sl:Predloga:Tn vi:Tiêu bản:Tn zh:Template:Tn

ro:Format:Cuprins dreapta ur:سانچہ:دائیں فہرست

Template:S-bef/doc


Visit Template:S-bef/doc to edit this text! (How does this work?)
Community content is available under CC-BY-SA unless otherwise noted.