Template:TOC: Difference between revisions

From MediaWiki
Jump to navigationJump to search
Saix (talk | contribs)
mNo edit summary
Tigerpaw28 (talk | contribs)
Fixing and enhancing the functionality of this template. It can now float left or right without falling into Derik's infinite transclusion loop and causing an error. Also dropped the pointless purplemonkeydishwasher parameter.
Line 1: Line 1:
<includeonly>{{#ifeq:{{{1|purplemonkeydishwasher}}}|purplemonkeydishwasher|__FORCETOC__}}{{#ifeq:{{{1|}}}|none|__NOTOC__}}{{#ifeq:{{{1|}}}|left|{{Template:TOC|left|mode=float}}}}{{#ifeq:{{{1|}}}|right|{{Template:TOC|right|mode=float}}}}{{#ifeq: {{{mode|}}}|float|
<includeonly>{{#if:{{{suppress|}}}|__NOTOC__|<div style="clear: {{{clear|none}}}; margin-bottom: .5em; float: {{{align|none}}}; {{#ifeq: {{lc:{{{align|}}}}} | right | margin-left:2.5em; | {{#ifeq: {{lc:{{{align|}}}}} | left | margin-right:2.5em; | <!-- align=none --> }} }} width: {{{width|auto}}};" {{#if:{{{limit|}}}|class="toclimit-{{{limit|}}}"}}>__TOC__</div>}}
{{{!}} style="float:{{{1|}}};"
</includeonly><noinclude>
{{!}}-
This template is no longer an affront before God, and can be used by anyone.
{{!}}__TOC__
 
{{!}}}
<pre>
}}</includeonly><noinclude>
{{TOC
This template is an affront before God, and should not be used by anyone.
|align= Which side to align the table of contents to. Aligns left by default.
|limit= The maximum header level to limit to. By default all headers are included.
|width= The width of the TOC. Defaults to 'auto'.
|clear= What to set the CSS 'clear' property to. This determines which side (or both) of the TOC things are not allowed to float on. Defaults to 'none'.
|suppress= If set to true, the TOC will be hidden completely.
}}
</pre>
{{TOC|align=right|limit=3|width=200px|clear=none}}
 


[[Category:Layout templates]]
[[Category:Layout templates]]
</noinclude>
</noinclude>

Revision as of 05:56, 17 December 2020

This template is no longer an affront before God, and can be used by anyone.

{{TOC
|align= Which side to align the table of contents to. Aligns left by default.
|limit= The maximum header level to limit to. By default all headers are included.
|width= The width of the TOC. Defaults to 'auto'.
|clear= What to set the CSS 'clear' property to. This determines which side (or both) of the TOC things are not allowed to float on. Defaults to 'none'.
|suppress= If set to true, the TOC will be hidden completely.
}}