Welcome to the TWC Wiki! You are not logged in. Please log in to the Wiki to vote in polls, change skin preferences, or edit pages. See HERE for details of how to LOG IN.

Difference between revisions of "Template:TOC right"

From TWC Wiki
Jump to navigationJump to search
(trying just for right side)
(don't think we've got the css for the limit stuff)
Line 18: Line 18:
 
===Changing the alignment of the table of contents===
 
===Changing the alignment of the table of contents===
 
To force the table of contents to appear on the right of a page, use the <nowiki>{{TOC right}}</nowiki> template.  The table of contents will appear wherever you place the template.
 
To force the table of contents to appear on the right of a page, use the <nowiki>{{TOC right}}</nowiki> template.  The table of contents will appear wherever you place the template.
 
 
===Limiting the headings listed in a table of contents===
 
Section headings create a hierarchy.  In this page's table of contents, note how Section 2, "Modifying the Table of Contents", contains several subsections.  These subsections could also contain subsections of their own. 
 
 
It's possible to limit the depth of headings which are included in the table using the <nowiki>{{toclimit}}</nowiki> template.  By setting a number value for <code>|limit=</code>, only headings of the specified level or greater will display.  For example, <code><nowiki>{{toclimit|limit=2}}</nowiki></code> will include only level two headings (<nowiki>==Heading==</nowiki>), while <code><nowiki>{{toclimit|limit=3}}</nowiki></code> will include level three headings (<nowiki>===Heading===</nowiki>) as well as level two headings, and so on.
 
 
Like the other TOC templates, <nowiki>{{toclimit}}</nowiki> will cause the table to appear wherever the template is placed on the page.  Additionally, both <nowiki>{{tocleft}}</nowiki> and <nowiki>{{tocright}}</nowiki> support the use of the <code>|limit</code> variable.
 
  
 
[[Category:Template]]
 
[[Category:Template]]
 
</noinclude>
 
</noinclude>

Revision as of 07:22, 20 April 2017

Tables of contents contain links to sections within an article, providing easy and automatic on-page navigation.

Standard Tables of Contents

Articles will include a default table of contents when more than three section headings appear. The default table of contents will include all section headings and will appear just before the first section heading. By default, the table of contents will be left aligned.

You may hide an individual table of contents when viewing an article by clicking the "hide" link in the table. Alternately, if you do not wish to see any tables of contents, you may deactivate their display entirely within the Misc tab of your user preferences. Simply uncheck the box next to "Show table of contents (for pages with more than 3 headings)" and no tables of contents will be displayed.

Modifying the Table of Contents

Several magic words and templates exist which modify the standard tables of contents.

Removing the Table of Contents from an article

To remove the table of contents from any article, simply add the magic word __NOTOC__ anywhere within the article. It's usually not advisable to do so, however.

Forcing and Moving the Table of Contents

To force the table of contents to appear regardless of how many headings an article has, simply add the magic word __TOC__ anywhere within the article. The table of contents will appear wherever you place the template, allowing you to move it up or down the page from its normal position.

Changing the alignment of the table of contents

To force the table of contents to appear on the right of a page, use the {{TOC right}} template. The table of contents will appear wherever you place the template.