Difference between revisions of "Template:TOC right/doc"

From Second Life Wiki
Jump to navigation Jump to search
(Shamelessly copied from wikipedia.org; has errors needing cleaning up)
 
(Cleaning up some explanations that may not be pertinent for the SL Wiki; prepared documentation to deal with *both* TOC left and right templates.)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
<!--Categories where indicated at the bottom of this page, please; interwikis at Wikidata (see [[Wikipedia:Wikidata]])-->
<!--Categories where indicated at the bottom of this page, please; interwikis at Wikidata (see [[Wikipedia:Wikidata]])-->
<!--{{High-use| 34448 }}-->
{{TOC right}}
{{TOC right}}
{{tsh|tocright|TOCright}}
<!--{{tsh|tocright|TOCright}}-->
{{Uses TemplateStyles|Template:TOC limit/styles.css|Template:TOC right/styles.css}}
<!--{{Uses TemplateStyles|Template:TOC limit/styles.css|Template:TOC right/styles.css}}-->
{{cleanup}}
{{cleanup}}
{{tl|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.
{{tl|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; {{tl|TOC left}} is the equivalent template to float the TOC to the left.


==Usage==
==Usage==
Insert <code>&#123;&#123;{{BASEPAGENAME}}&#125;&#125;</code> 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 [[MOS:LEADELEMENTS]]. Use with {{tl|-}} or {{tl|clear}} to prevent collision with text; use the '''clear''' parameter (see below) to prevent collision with images.
* Insert <code>&#123;&#123;{{BASEPAGENAME}}&#125;&#125;</code> 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|MOS:LEADELEMENTS}}. Use with {{tl|-}} or {{tl|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.
* Avoid placing the TOC in a visually poor location. Crossing a section division is probably a poor idea.
 
<!--
;width: Set the CSS width.
;width: Set the CSS width.


;limit: Limits the depth of subheadings shown. For instance using <code>limit=4</code> will hide the fourth level and deeper subheadings in the hierarchy. And <code>limit=2</code> will hide all subheadings leaving only the main headings. This works by hiding the lower levels with CSS. See [[Template:TOC limit/styles.css]].
;limit: Limits the depth of subheadings shown. For instance using <code>limit=4</code> will hide the fourth level and deeper subheadings in the hierarchy. And <code>limit=2</code> will hide all subheadings leaving only the main headings. This works by hiding the lower levels with CSS. See {{Wikipedia|Template:TOC limit/styles.css}}.


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.
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.
Line 21: Line 20:
Unless the section in which the {{tl|TOC right}} is placed is long enough, the result may well be undesirable.  
Unless the section in which the {{tl|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.
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 {{Wikipedia|Help:Section#Floating the TOC|Floating the TOC}} for further guidelines.
 
==TemplateData==
 
{{templatedata header}}


<templatedata>
<templatedata>
<syntaxhighlight lang="json">
{
{
"params": {
"params": {
Line 52: Line 56:
"format": "inline"
"format": "inline"
}
}
</templatedata>
</syntaxhighlight>
</templatedata>-->
 
==Note==
Unlike Wikipedia, which uses [https://www.mediawiki.org/wiki/Extension:TemplateStyles TemplateStyles], the SL Wiki already included a reasonably good 'hacked' {{Tl|TOC}} template, and {{Tl|{{BASEPAGENAME}}}} only redirects it (probably badly).<ref>Still a work in progress, mind you — {{u|Gwyneth Llewelyn}}</ref>


==See also==
==See also==
* {{Lts|TOC}}
* {{Lts|TOC right}}
* {{Lts|TOC left}}
* {{Lts|TOC left}}


<includeonly>{{Sandbox other||
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
<!-- Categories below this line, please; interwikis at Wikidata -->
{{DEFAULTSORT:Toc Right}}
<!--{{DEFAULTSORT:Toc Right}}--><!-- Merged documentation for left and right in the same spot-->
[[Category:Wikipedia table of contents templates]]
[[Category:Wikipedia table of contents templates]]


}}</includeonly>
}}</includeonly>

Latest revision as of 16:27, 10 June 2023


{{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; {{TOC left}} is the equivalent template to float the TOC to the left.

Usage

  • Insert {{TOC right}} 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 logo"MOS:LEADELEMENTS. 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.

Note

Unlike Wikipedia, which uses TemplateStyles, the SL Wiki already included a reasonably good 'hacked' {{TOC}} template, and {{TOC right}} only redirects it (probably badly).[1]

See also


  1. Still a work in progress, mind you — Gwyneth Llewelyn