Template:TOC: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Russell D. Jones
(margins)
imported>Russell D. Jones
(Removing case specificity)
 
Line 1: Line 1:
<includeonly><div style="float:{{{1|none}}}; clear:{{{1|none}}}; margin:{{#ifeq:{{{1}}}|right|0 0 0.5em 0.3em|0 0.3em 0.5em 0}}; padding:{{#ifeq:{{{1}}}|right|0.5em 0 0.8em 1.4em|0.5em 1.4em 0.8em 0}};">__TOC__</div></includeonly><noinclude>{{TlDoc}}</noinclude>
<includeonly><div style="float:{{{1|none}}}; clear:{{{1|none}}}; margin:{{#ifeq:{{{1}}}|right|0 0 0.5em 0.3em|{{#ifeq:{{{1}}}|Right|0 0 0.5em 0.3em|0 0.3em 0.5em 0}}}}; padding:{{#ifeq:{{{1}}}|right|0.5em 0 0.8em 1.4em|{{#ifeq:{{{1}}}|Right|0.5em 0 0.8em 1.4em|0.5em 1.4em 0.8em 0}}}};">__TOC__</div></includeonly><noinclude>{{TlDoc}}</noinclude>

Latest revision as of 11:17, 15 February 2010

This documentation is transcluded from Template:TOC/doc (edit | history)

On CZ articles with more than three sections (other than the introductory paragraph), a table of contents will automatically appear just above the first header.

This template allows the table of contents to be inserted at any point on the page, as well as allowing it to be floated to one side rather than pushing the following text below it.

Usage

{{TOC}}
Inserts a standard TOC, but at the current position on the page. Text appearing after this code will be shown below the TOC. More or less equivalent to __TOC__.
{{TOC|right}} or {{TOC|Right}}
Inserts a TOC at the current position on the page and floated to the right of text appearing after this code with a margin and padding. Note, as in nearly everything else on Mediawiki, case matters (at present other case renderings of "right" [e.g., "RIGHT"] will be probably rendered as "none"). This is the default control variable. Other position variables (left, center, auto, none) are not coded in this template and may produce unpredictable results.
{{TOC|left}} or {{TOC|Left}} or {{TOC|LEFT}}
Inserts a TOC at the current position on the page and floated to the left of text appearing after this code with a margin and padding.
{{TOC|none}} or {{TOC|center}}
Any other variable usable with the "float" or "text-align" CSS functions will probably render the TOC as it would without the variable, that is, as if it were coded with a non-attribute {{TOC}} template.

It is not possible to show the TOC more than once on the same page. It will only be shown the first time it is called.

Example

The code {{TOC|right}} is used after the first paragraph below :

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.