Jump to content

Template:TOCfloat: Difference between revisions

m
oops
(better explanation)
m (oops)
Line 1: Line 1:
<includeonly><div style="clear:left; margin-bottom:0.5em; float:{{{side|left}}}; padding:0.5em 1.4em 0.8em 0; background:none; width:{{{width|{{{1|auto}}}}}};" {{#if:{{{limit|}}}|class="toclimit-{{{limit}}}"}}>__TOC__</div></includeonly><noinclude>Especially for articles which do not have a [[wikipedia:WP:LEDE|lede]], a long Table Of Contents (TOC) can be visually unsettling -- "Hey, where's the article? There's just this long box!" Sometimes it's just the only right way to do things, as in [[Quotes/Speech]]. But for a more normal article like [[Daodan DLL]], it would look bad if the article started after the lengthy TOC. Use this template to make the TOC a floating table, so that the article text wraps around it. See the "toclimit" classes in [[MediaWiki:Common.css]] for another way to avoid the problem of long TOCs, but note that '''TOCfloat''' also offers the optional use of "toclimit".
<includeonly><div style="clear:left; margin-bottom:0.5em; float:{{{side|left}}}; padding:0.5em 1.4em 0.8em 0; background:none; width:{{{width|{{{1|auto}}}}}};" {{#if:{{{limit|}}}|class="toclimit-{{{limit}}}"}}>__TOC__</div></includeonly><noinclude>Especially for articles which do not have a [[wikipedia:WP:LEDE|lede]], a long Table Of Contents (TOC) can be visually unsettling -- "Hey, where's the article? There's just this long box!" Sometimes it's just the only right way to do things, as in [[Quotes/Speech]]. But for a more normal article like [[Daodan DLL]], it would look bad if the article started after the lengthy TOC. Use this template to make the TOC a floating table, so that the article text wraps around it. See the "toclimit" classes in [[MediaWiki:Common.css]] for another way to avoid the problem of long TOCs, but note that '''TOCfloat''' also offers the optional use of "toclimit".


It's important to have a grasp of proper wiki article layout, because this template includes the magic word <nowiki>__TOC__</nowiki>, which determines the TOC's position within the article. Thus, in order to preserve the standard layout, this means that you should <u>you have to place the template markup between the lede text (if there is any) and the first subheader</u> in the article. The Daodan article above demonstrates proper layout with (1) a lede that describes the DLL briefly without the use of a section header, followed by (2) the TOC, followed by (3) the article's body with subheaders. The fact that the body is now wrapping around the TOC does not change the order of layout elements; it merely improves its appearance.
It's important to have a grasp of proper wiki article layout, because this template includes the magic word <nowiki>__TOC__</nowiki>, which determines the TOC's position within the article. Thus, in order to preserve the standard layout, this means that <u>you have to place the template markup between the lede text (if there is any) and the first subheader</u> in the article. The Daodan article above demonstrates proper layout with (1) a lede that describes the DLL briefly without the use of a section header, followed by (2) the TOC, followed by (3) the article's body with subheaders. The fact that the body is now wrapping around the TOC does not change the order of layout elements; it merely improves its appearance.


Optional parameters:
Optional parameters: