Template:TOC top: Difference between revisions
From BoyWiki
Created page with "<includeonly></div></includeonly><noinclude>{{documentation}}</noinclude>" |
No edit summary |
||
Line 1: | Line 1: | ||
< | {{#ifeq:{{{primary|}}}|false||__NOTOC__}}<div class="toc plainlinks hlist" {{#ifeq:{{{primary|}}}|false||id="toc"}} style="{{#switch:{{lc:{{{align|}}}}} | ||
|left=float: left; clear: {{{clear|left}}}; | |||
|right=float: right; clear: {{{clear|right}}}; | |||
|center= margin:auto; clear: {{{clear|none}}}; | |||
|#default=clear: {{{clear|left}}}; | |||
}}"> | |||
<div {{#ifeq:{{{primary|}}}|false|style="text-align:center"|id="toctitle"}}>{{#ifeq:{{{primary|}}}|false|<strong>{{{title|{{MediaWiki:Toc}} }}}</strong>|<h2>{{{title|{{MediaWiki:Toc}} }}}</h2>}} | |||
</div> | |||
<noinclude> | |||
{{TOC bottom}} | |||
{{documentation}}</noinclude> |
Latest revision as of 13:49, 5 May 2016
Contents
BoyWiki Template documentation (for the above template, sometimes hidden or invisible)
This is used to create custom table of contents templates such as
{{list TOC}}. It replaces and suppresses the ToC that the wiki software would automatically generate.
Usage
Please note that this is solely for ease of maintaining existing templates. Please do not use this to write new templates: instead, browse through Category:Category templates and use an existing template. This code is one of the final pieces in cleaning up years of redundant and overlapping code in this area.
Parameters (optional)
- title
- The title to use for this ToC element. The default is Contents.
- align
- Sets the CSS float and clear properties, which forces this float underneath the side specified with this attribute. So,
align=right
will place the element after all the right floating elements before it. Options areleft
,right
,center
, ornone
(default).
- clear
- Overrides the default CSS clear property set by the align parameter, which is not typically needed. Options are
left
,right
,both
, ornone
. The defaults areleft
when|align=left
,right
when|align=right
,none
when|align=center
, andleft
when|align=none
. Use|clear=none
to allow other floating elements to float next to the table of contents, and|clear=both
to force the table of contents to have nothing next to it.
- primary
- Set this to
false
if this ToC is not used as the primary ToC of a page. This makes sure that the title of this ToC does not show up in the primary ToC. A side effect of this is the disappearing of the show/hide toggle.
Visit Template:TOC top/doc to edit this template's description!
Done making changes? Refresh Also see: Portal:Template index and Help:Templates
Done making changes? Refresh Also see: Portal:Template index and Help:Templates