Difference between revisions of "Template:Compact ToC"

From DMARC Wiki
Jump to navigation Jump to search
m (Two new features.)
m (New feature.)
Line 2: Line 2:
 
! {{MediaWiki:Toc}}{{#ifeq:{{{side|}}}|yes|:|}}
 
! {{MediaWiki:Toc}}{{#ifeq:{{{side|}}}|yes|:|}}
 
{{#ifeq:{{{side|}}}|yes|{{!}}|{{!}}-}}
 
{{#ifeq:{{{side|}}}|yes|{{!}}|{{!}}-}}
|{{#ifeq:{{{top|}}}|yes|[[#top{{!}}Top]]&nbsp;|}}{{#ifeq:{{{sym|}}}|yes|[[#!$@|!$@]]&nbsp;|}}{{#ifeq:{{{num|}}}|yes|[[#0–9|0–9]]&nbsp;|}}{{#ifeq:{{{symnum|}}}|yes|[[#!–9|!–9]]&nbsp;|}}[[#A|A]] [[#B|B]] [[#C|C]] [[#D|D]] [[#E|E]] [[#F|F]] [[#G|G]] [[#H|H]] [[#I|I]] [[#J|J]] [[#K|K]] [[#L|L]] [[#M|M]] [[#N|N]] [[#O|O]] [[#P|P]] [[#Q|Q]] [[#R|R]] [[#S|S]] [[#T|T]] [[#U|U]] [[#V|V]] [[#W|W]] [[#X|X]] [[#Y|Y]] [[#Z|Z]] <br />
+
|{{#ifeq:{{{top|}}}|yes|[[#top{{!}}Top]]&nbsp;|}}{{#ifeq:{{{sym|}}}|yes|[[#!$@|!$@]]&nbsp;|}}{{#ifeq:{{{num|}}}|yes|[[#0–9|0–9]]&nbsp;|}}{{#ifeq:{{{symnum|}}}|yes|[[#!–9|!–9]]&nbsp;|}}[[#A|A]] [[#B|B]] [[#C|C]] [[#D|D]] [[#E|E]] [[#F|F]] [[#G|G]] [[#H|H]] [[#I|I]] [[#J|J]] [[#K|K]] [[#L|L]] [[#M|M]] [[#N|N]] [[#O|O]] [[#P|P]] [[#Q|Q]] [[#R|R]] [[#S|S]] [[#T|T]] [[#U|U]] [[#V|V]] [[#W|W]] [[#X|X]] [[#Y|Y]] [[#Z|Z]] {{#ifeq:{{{nobreak|}}}|yes|&nbsp;|<br />
<div style="text-align:center;">{{#ifeq:{{{seealso|}}}|yes|[[#See also{{!}}&nbsp;&nbsp;&nbsp;See also&nbsp;&nbsp;&nbsp;]]|}} {{#ifeq:{{{refs|}}}|yes|[[#References{{!}}&nbsp;&nbsp;&nbsp;References&nbsp;&nbsp;&nbsp;]]|}} {{#ifeq:{{{notes|}}}|yes|[[#Notes{{!}}&nbsp;&nbsp;&nbsp;Notes&nbsp;&nbsp;&nbsp;]]|}} {{#ifeq:{{{extlinks|}}}|yes|[[#External links{{!}}&nbsp;&nbsp;&nbsp;External links&nbsp;&nbsp;&nbsp;]]|}}</div>
+
<div style="text-align:center;">}}{{#ifeq:{{{seealso|}}}|yes|[[#See also{{!}}&nbsp;&nbsp;&nbsp;See also&nbsp;&nbsp;&nbsp;]]|}} {{#ifeq:{{{refs|}}}|yes|[[#References{{!}}&nbsp;&nbsp;&nbsp;References&nbsp;&nbsp;&nbsp;]]|}} {{#ifeq:{{{notes|}}}|yes|[[#Notes{{!}}&nbsp;&nbsp;&nbsp;Notes&nbsp;&nbsp;&nbsp;]]|}} {{#ifeq:{{{extlinks|}}}|yes|[[#External links{{!}}&nbsp;&nbsp;&nbsp;External links&nbsp;&nbsp;&nbsp;]]|}}</div>
 
|}__NOTOC__<noinclude>
 
|}__NOTOC__<noinclude>
  
Line 13: Line 13:
  
 
==Usage==
 
==Usage==
<code><nowiki>{{</nowiki>'''CompactTOC8'''<nowiki>|side=yes|center=yes|top=yes|num=yes|sym=yes|symnum=yes|seealso=yes|refs=yes|notes=yes|extlinks=yes}}</nowiki></code>
+
<code><nowiki>{{</nowiki>'''CompactTOC8'''<nowiki>|side=yes|center=yes|nobreak=yes|top=yes|num=yes|sym=yes|symnum=yes|seealso=yes|refs=yes|notes=yes|extlinks=yes}}</nowiki></code>
 
<br />for all features (leave off or change to "no" to disable a feature}}
 
<br />for all features (leave off or change to "no" to disable a feature}}
  
Line 19: Line 19:
 
*<code>side=yes</code> &mdash; put the "Contents" heading on the left side with a colon, instead of the top without one
 
*<code>side=yes</code> &mdash; put the "Contents" heading on the left side with a colon, instead of the top without one
 
*<code>center=yes</code> &mdash; center to ToC in the horizontal middle of the page, instead of floated left
 
*<code>center=yes</code> &mdash; center to ToC in the horizontal middle of the page, instead of floated left
 +
*<code>nobreak=yes</code> &mdash; no linebreak between the A-B-C-etc. stuff and the See also/References/etc. stuff (note: does not affect the heading; use <code>side=</code> for that)
 
*<code>top=yes</code> &mdash; enable the "Top" link; this is only useful if this copy of the ToC is at the bottom (or middle, theoretically) of the page, as a secondary ToC (requires <code><nowiki><span name="top"></span></nowiki></code> at the top of the page)
 
*<code>top=yes</code> &mdash; enable the "Top" link; this is only useful if this copy of the ToC is at the bottom (or middle, theoretically) of the page, as a secondary ToC (requires <code><nowiki><span name="top"></span></nowiki></code> at the top of the page)
 
*<code>sym=yes</code> &mdash; enable the "!$@" link for symbolic entries section
 
*<code>sym=yes</code> &mdash; enable the "!$@" link for symbolic entries section
Line 51: Line 52:
 
{{tlx|CompactTOC8|side&#61;yes|center&#61;yes|symnum&#61;yes|seealso&#61;yes}}
 
{{tlx|CompactTOC8|side&#61;yes|center&#61;yes|symnum&#61;yes|seealso&#61;yes}}
 
{{CompactTOC8|side=yes|center=yes|symnum=yes|seealso=yes}}
 
{{CompactTOC8|side=yes|center=yes|symnum=yes|seealso=yes}}
 +
 +
 +
 +
<code><nowiki>{{</nowiki>'''CompactTOC8'''<nowiki>|side=yes|center=yes|nobreak=yes|top=yes|num=yes|sym=yes|seealso=yes|refs=yes|notes=yes|extlinks=yes}}</nowiki></code>
 +
  
  

Revision as of 10:21, 24 April 2007

Contents
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z



{{#invoke:Message box|ombox}}

Purpose

This Table of Contents replacement for alphabetical lists provides all the features of Template:CompactTOC7, plus ones from Template:CompactTOC2, etc. that #7 doesn't have (the "Top" "0-9" sections, optionally), and allows you to select what other sections you want. Even the centering is optional, and you can have the "Contents" heading on the top (default) or the side.

Usage

{{CompactTOC8|side=yes|center=yes|nobreak=yes|top=yes|num=yes|sym=yes|symnum=yes|seealso=yes|refs=yes|notes=yes|extlinks=yes}}
for all features (leave off or change to "no" to disable a feature}}

Parameters

  • side=yes — put the "Contents" heading on the left side with a colon, instead of the top without one
  • center=yes — center to ToC in the horizontal middle of the page, instead of floated left
  • nobreak=yes — no linebreak between the A-B-C-etc. stuff and the See also/References/etc. stuff (note: does not affect the heading; use side= for that)
  • top=yes — enable the "Top" link; this is only useful if this copy of the ToC is at the bottom (or middle, theoretically) of the page, as a secondary ToC (requires <span name="top"></span> at the top of the page)
  • sym=yes — enable the "!$@" link for symbolic entries section
  • num=yes — enable the "0–9" link for numeric entries section (note that it is "–" not "-")
  • symnum=yes — enable the "!–9" link for combined symbolic and numeric entries section (note that it is "–" not "-", and that the preceding two options are mutually exclusive with this one)
  • seealso=yes — enable link to the "See also" section (note that it is plural)
  • refs=yes — enable link to the "References" section (note that it is plural)
  • notes=yes — enable link to the "Notes" section (note that it is plural)
  • extlinks=yes — enable link to the "External links" section

Examples

{{CompactTOC8|top=yes}} Template:CompactTOC8


{{CompactTOC8|center=yes|top=yes|seealso=yes}} Template:CompactTOC8


{{CompactTOC8|side=yes|sym=yes|num=yes|refs=yes}} Template:CompactTOC8


{{CompactTOC8|top=no|refs=yes|notes=yes|extlinks=yes}} Template:CompactTOC8


{{CompactTOC8|side=yes|center=yes|symnum=yes|seealso=yes}} Template:CompactTOC8


{{CompactTOC8|side=yes|center=yes|nobreak=yes|top=yes|num=yes|sym=yes|seealso=yes|refs=yes|notes=yes|extlinks=yes}}