Template:List TOC: Difference between revisions

From Miranda NG
Jump to navigation Jump to search
(+category (Glossary templates))
(clean copy)
Line 1: Line 1:
__NOTOC__{{ #ifeq: {{{center|{{ #ifeq: {{{1}}} | short1 | yes }}}}} | yes | <div style="text-align: center;"> }}<div class="toc plainlinks hlist" id="toc" style="{{ #ifeq: {{{center|{{ #ifeq: {{{1}}} | short1 | yes }}}}} | yes | margin-left: auto; margin-right: auto; | {{ #ifeq: {{{right}}} | yes | float: right; clear: right; }} }} text-align: {{{align|left}}};">
{{#if:{{{allowtoc|}}}||__NOTOC__}}<!--
{{ #ifeq: {{{name}}} | no || <div id="toctitle" style="text-align: center; {{ #ifeq: {{{side|{{ #ifeq:{{{1}}} | short1 | yes }}}}} | yes | display: inline-block; }}"><span style="font-weight: bold;">{{{name|{{MediaWiki:Toc}}&nbsp;}}}{{ #ifeq: {{{side|{{ #ifeq: {{{1}}} | short1 | yes }}}}} | yes | &#58; }}</span></div> }}
-->{{#ifeq:{{{center|{{#ifeq:{{{1}}}|short1|yes}}}}}|yes |
<div style="margin: auto; white-space: nowrap; {{ #ifeq: {{{side|{{ #ifeq: {{{1}}} | short1 | yes }}}}} | yes | display: inline-block; }}">{{ #ifeq: {{{top}}} | yes |
<div style="text-align:center;"><!--
* [[#top|Top]]}} {{ #if: {{{pre1|{{{preSec1|}}} }}} |
-->}}<!--
* [[{{{pre1link|{{{preSec1link|#{{{pre1|{{{preSec1}}} }}} }}} }}}|{{{pre1name|{{{preSec1name|{{{pre1|{{{preSec1}}} }}} }}} }}}]] }} {{ #if: {{{pre2|{{{preSec2|}}} }}} |
 
* [[{{{pre2link|{{{preSec2link|#{{{pre2|{{{preSec2}}} }}} }}} }}}|{{{pre2name|{{{preSec2name|{{{pre2|{{{preSec2}}} }}} }}} }}}]] }} {{ #if: {{{pre3|{{{preSec3|}}} }}} |
Start contents box
* [[{{{pre3link|{{{preSec3link|#{{{pre3|{{{preSec3}}} }}} }}} }}}|{{{pre3name|{{{preSec3name|{{{pre3|{{{preSec3}}} }}} }}} }}}]] }} {{ #if: {{{pre4|{{{preSec4|}}} }}} |
 
* [[{{{pre4link|{{{preSec4link|#{{{pre4|{{{preSec4}}} }}} }}} }}}|{{{pre4name|{{{preSec4name|{{{pre4|{{{preSec4}}} }}} }}} }}}]] }} {{ #if: {{{pre5|{{{preSec5|}}} }}} |
--><div id="toc" class="toc plainlinks hlist"
* [[{{{pre5link|{{{preSec5link|#{{{pre5|{{{preSec5}}} }}} }}} }}}|{{{pre5name|{{{preSec5name|{{{pre5|{{{preSec5}}} }}} }}} }}}]] }} {{ #if: {{{pre6|{{{preSec6|}}} }}} |
        style="{{#ifeq:{{{center|{{#ifeq:{{{1}}}|short1|yes}}}}}|yes |margin-left:auto;margin-right:auto;
* [[{{{pre6link|{{{preSec6link|#{{{pre6|{{{preSec6}}} }}} }}} }}}|{{{pre6name|{{{preSec6name|{{{pre6|{{{preSec6}}} }}} }}} }}}]] }} {{ #if: {{{pre7|{{{preSec7|}}} }}} |
                | {{#ifeq:{{{right}}}|yes |clear:right;float:right;}}
* [[{{{pre7link|{{{preSec7link|#{{{pre7|{{{preSec7}}} }}} }}} }}}|{{{pre7name|{{{preSec7name|{{{pre7|{{{preSec7}}} }}} }}} }}}]] }} {{ #if: {{{pre8|{{{preSec8|}}} }}} |
                }} text-align:{{{align|left}}};">
* [[{{{pre8link|{{{preSec8link|#{{{pre8|{{{preSec8}}} }}} }}} }}}|{{{pre8name|{{{preSec8name|{{{pre8|{{{preSec8}}} }}} }}} }}}]] }} {{ #if: {{{prebreak|}}} | {{{prebreak}}}</ul> }} {{ #ifeq: {{{sym}}} | yes |
<!--
* [[#!$@|!$@]] }} {{ #ifeq: {{{num}}} | yes |
 
* {{{0-9|[[#0–9|0–9]]}}} }}{{ #ifeq: {{{symnum}}} | yes |
"[name]/Contents"
* [[#!–9|!–9]] }}
 
    -->{{#ifeq:{{{name}}}|no |
        |   <div id="toctitle" style="text-align:center;{{#ifeq:{{{side|{{#ifeq:{{{1}}}|short1|yes}}}}}|yes |display:inline-block;}}"><!--
              --><span style="font-weight:bold;">{{{name|{{MediaWiki:Toc}}&nbsp;}}}{{#ifeq:{{{side|{{#ifeq:{{{1}}}|short1|yes}}}}}|yes |&#58;<!--(colon)-->}}</span><!--
          --></div><!--
    -->}}
<!--
 
Links
 
    --><div style="margin:auto;white-space:nowrap;{{#ifeq:{{{side|{{#ifeq:{{{1}}}|short1|yes}}}}}|yes |display:inline-block;}}"><!--
            -->{{#ifeq:{{{top}}}|yes |
* [[#top|Top]]}}<!--
            -->{{#if:{{{pre1|{{{preSec1|}}}}}} |
* [[{{{pre1link|{{{preSec1link|#{{{pre1|{{{preSec1}}} }}} }}} }}}|{{{pre1name|{{{preSec1name|{{{pre1|{{{preSec1}}} }}} }}} }}}]] <!--
            -->}} {{#if:{{{pre2|{{{preSec2|}}}}}} |
* [[{{{pre2link|{{{preSec2link|#{{{pre2|{{{preSec2}}} }}} }}} }}}|{{{pre2name|{{{preSec2name|{{{pre2|{{{preSec2}}} }}} }}} }}}]] <!--
              -->}} {{#if:{{{pre3|{{{preSec3|}}}}}} |
* [[{{{pre3link|{{{preSec3link|#{{{pre3|{{{preSec3}}} }}} }}} }}}|{{{pre3name|{{{preSec3name|{{{pre3|{{{preSec3}}} }}} }}} }}}]] <!--
                  -->}} {{#if:{{{pre4|{{{preSec4|}}}}}} |
* [[{{{pre4link|{{{preSec4link|#{{{pre4|{{{preSec4}}} }}} }}} }}}|{{{pre4name|{{{preSec4name|{{{pre4|{{{preSec4}}} }}} }}} }}}]] <!--
                    -->}} {{#if:{{{pre5|{{{preSec5|}}}}}} |
* [[{{{pre5link|{{{preSec5link|#{{{pre5|{{{preSec5}}} }}} }}} }}}|{{{pre5name|{{{preSec5name|{{{pre5|{{{preSec5}}} }}} }}} }}}]] <!--
                        -->}} {{#if:{{{pre6|{{{preSec6|}}}}}} |
* [[{{{pre6link|{{{preSec6link|#{{{pre6|{{{preSec6}}} }}} }}} }}}|{{{pre6name|{{{preSec6name|{{{pre6|{{{preSec6}}} }}} }}} }}}]] <!--
                          -->}} {{#if:{{{pre7|{{{preSec7|}}}}}} |
* [[{{{pre7link|{{{preSec7link|#{{{pre7|{{{preSec7}}} }}} }}} }}}|{{{pre7name|{{{preSec7name|{{{pre7|{{{preSec7}}} }}} }}} }}}]] <!--
                              -->}} {{#if:{{{pre8|{{{preSec8|}}}}}} |
* [[{{{pre8link|{{{preSec8link|#{{{pre8|{{{preSec8}}} }}} }}} }}}|{{{pre8name|{{{preSec8name|{{{pre8|{{{preSec8}}} }}} }}} }}}]] <!--
                                -->}} {{#if:{{{prebreak|}}} |{{#ifeq:{{{prebreak|}}}|yes|<br />|{{{prebreak}}}[[Category:Pages using compact toc with deprecated syntax]]}}</ul>}} <!--
-->{{#ifeq:{{{sym}}}|yes |
* [[#!$@|!$@]] }}<!--
-->{{#ifeq:{{{num}}}|yes |
* {{{0-9|[[#0–9|0–9]]}}} }}<!--
-->{{#ifeq:{{{symnum}}}|yes |
* [[#!–9|!–9]] }}{{#ifeq:{{{letters}}}|no||
* {{{a|[[#A|A]]}}}
* {{{a|[[#A|A]]}}}
* {{{b|[[#B|B]]}}}
* {{{b|[[#B|B]]}}}
Line 39: Line 74:
* {{{x|[[#X|X]]}}}
* {{{x|[[#X|X]]}}}
* {{{y|[[#Y|Y]]}}}
* {{{y|[[#Y|Y]]}}}
* {{{z|[[#Z|Z]]}}} {{ #ifeq: {{{nobreak|{{ #ifeq: {{{1}}} | short1 | yes }}}}} | yes || </ul> }} {{ #if: {{{custom1|{{{Sec1|}}} }}} |
* {{{z|[[#Z|Z]]}}}}} <!--
* [[{{{custom1link|{{{Sec1link|#{{{custom1|{{{Sec1}}} }}} }}} }}}|{{{custom1name|{{{Sec1name|{{{custom1|{{{Sec1}}} }}} }}} }}}]] }}{{ #if: {{{custom2|{{{Sec2|}}} }}} |
-->{{#ifeq:{{{nobreak|{{#ifeq:{{{1}}}|short1|yes}}}}}|yes | |</ul>}}<!--
* [[{{{custom2link|{{{Sec2link|#{{{custom2|{{{Sec2}}} }}} }}} }}}|{{{custom2name|{{{Sec2name|{{{custom2|{{{Sec2}}} }}} }}} }}}]] }}{{ #if: {{{custom3|{{{Sec3|}}} }}} |
 
* [[{{{custom3link|{{{Sec3link|#{{{custom3|{{{Sec3}}} }}} }}} }}}|{{{custom3name|{{{Sec3name|{{{custom3|{{{Sec3}}} }}} }}} }}}]] }}{{ #if: {{{custom4|{{{Sec4|}}} }}} |
Custom links
* [[{{{custom4link|{{{Sec4link|#{{{custom4|{{{Sec4}}} }}} }}} }}}|{{{custom4name|{{{Sec4name|{{{custom4|{{{Sec4}}} }}} }}} }}}]] }}{{ #if: {{{custom5|{{{Sec5|}}} }}} |
 
* [[{{{custom5link|{{{Sec5link|#{{{custom5|{{{Sec5}}} }}} }}} }}}|{{{custom5name|{{{Sec5name|{{{custom5|{{{Sec5}}} }}} }}} }}}]] }}{{ #if: {{{custom6|{{{Sec6|}}} }}} |
-->{{#if:{{{custom1|{{{Sec1|}}}}}} |
* [[{{{custom6link|{{{Sec6link|#{{{custom6|{{{Sec6}}} }}} }}} }}}|{{{custom6name|{{{Sec6name|{{{custom6|{{{Sec6}}} }}} }}} }}}]] }}{{ #if: {{{custom7|{{{Sec7|}}} }}} |
* [[{{{custom1link|{{{Sec1link|#{{{custom1|{{{Sec1}}} }}} }}} }}}|{{{custom1name|{{{Sec1name|{{{custom1|{{{Sec1}}} }}} }}} }}}]] <!--
* [[{{{custom7link|{{{Sec7link|#{{{custom7|{{{Sec7}}} }}} }}} }}}|{{{custom7name|{{{Sec7name|{{{custom7|{{{Sec7}}} }}} }}} }}}]] }}{{ #if: {{{custom8|{{{Sec8|}}} }}} |
-->}} {{#if:{{{custom2|{{{Sec2|}}}}}} |
* [[{{{custom8link|{{{Sec8link|#{{{custom8|{{{Sec8}}} }}} }}} }}}|{{{custom8name|{{{Sec8name|{{{custom8|{{{Sec8}}} }}} }}} }}}]] }}{{ #ifeq: {{{seealso}}} | yes |
* [[{{{custom2link|{{{Sec2link|#{{{custom2|{{{Sec2}}} }}} }}} }}}|{{{custom2name|{{{Sec2name|{{{custom2|{{{Sec2}}} }}} }}} }}}]] <!--
* [[#See also|See also]] }}{{ #ifeq: {{{notesfirst}}} | yes |
  -->}} {{#if:{{{custom3|{{{Sec3|}}}}}} |
* [[#Notes|Notes]] }}{{ #ifeq: {{{refs|{{ #ifeq: {{{1}}} | short1 | yes }}}}} | yes |
* [[{{{custom3link|{{{Sec3link|#{{{custom3|{{{Sec3}}} }}} }}} }}}|{{{custom3name|{{{Sec3name|{{{custom3|{{{Sec3}}} }}} }}} }}}]] <!--
* [[#References|References]] }}{{ #ifeq: {{{notes}}} | yes |
      -->}} {{#if:{{{custom4|{{{Sec4|}}}}}} |
* [[#Notes|Notes]] }}{{ #ifeq: {{{further}}} | yes |
* [[{{{custom4link|{{{Sec4link|#{{{custom4|{{{Sec4}}} }}} }}} }}}|{{{custom4name|{{{Sec4name|{{{custom4|{{{Sec4}}} }}} }}} }}}]] <!--
* [[#Further reading|Further reading]] }}{{ #ifeq: {{{extlinks}}} | yes |
        -->}} {{#if:{{{custom5|{{{Sec5|}}}}}} |
* [[#External links|External links]] }}
* [[{{{custom5link|{{{Sec5link|#{{{custom5|{{{Sec5}}} }}} }}} }}}|{{{custom5name|{{{Sec5name|{{{custom5|{{{Sec5}}} }}} }}} }}}]] <!--
</div>
            -->}} {{#if:{{{custom6|{{{Sec6|}}}}}} |
</div>{{ #ifeq: {{{center|{{ #ifeq: {{{1}}} | short1 | yes }}}}} | yes | </div> }}<noinclude>
* [[{{{custom6link|{{{Sec6link|#{{{custom6|{{{Sec6}}} }}} }}} }}}|{{{custom6name|{{{Sec6name|{{{custom6|{{{Sec6}}} }}} }}} }}}]] <!--
              -->}} {{#if:{{{custom7|{{{Sec7|}}}}}} |
* [[{{{custom7link|{{{Sec7link|#{{{custom7|{{{Sec7}}} }}} }}} }}}|{{{custom7name|{{{Sec7name|{{{custom7|{{{Sec7}}} }}} }}} }}}]] <!--
                  -->}} {{#if:{{{custom8|{{{Sec8|}}}}}} |
* [[{{{custom8link|{{{Sec8link|#{{{custom8|{{{Sec8}}} }}} }}} }}}|{{{custom8name|{{{Sec8name|{{{custom8|{{{Sec8}}} }}} }}} }}}]] <!--
                    -->}}<!--
 
"See also" etc links
 
-->{{#ifeq:{{{seealso}}}|yes |
* [[#See also|See also]] }}<!--
-->{{#ifeq:{{{notesfirst}}}|yes |
* [[#Notes|Notes]] }}<!--
-->{{#ifeq:{{{refs|{{#ifeq:{{{1}}}|short1|yes}}}}}|yes |
* [[#References|References]] }}<!--
-->{{#ifeq:{{{notes}}}|yes |
* [[#Notes|Notes]] }}<!--
-->{{#ifeq:{{{further}}}|yes |
* [[#Further reading|Further reading]] }}<!--
-->{{#ifeq:{{{extlinks}}}|yes |
* [[#External links|External links]] <!--
-->}}
<!-- --></div><!--
 
End contents box
 
--></div><!--
 
-->{{#ifeq:{{{center|{{#ifeq:{{{1}}}|short1|yes}}}}}|yes |
</div><!--
-->}}<noinclude>
{{Documentation}}<!-- please add category and language links to the /doc sub-page, not here -->
{{Documentation}}<!-- please add category and language links to the /doc sub-page, not here -->
[[Category:Glossary templates]]
[[Category:Glossary templates]]
</noinclude>
</noinclude>

Revision as of 18:59, 28 June 2015

Template documentation[view] [edit] [history] [purge]

Usage

This template creates a horizontal table of contents with links from A to Z and four optional rows of links. It is intended primarily for list articles where the standard TOC would be unwieldy. The template is styled with the hlist class for accessibility and has few superfluous frills.

The A–Z links are always created (to control which letters appear, use {{List TOC Letters}} instead). Two upper rows can be defined using a1 through a20 and b1 through b20. Two lower rows can be defined using c1 through c20 and d1 through d20.

Examples

{{List TOC
|c1=White|c2=Pink|c3=Red|c4=Orange|c5=Brown|c6=Yellow|c7=Gray|c8=Green|c9=Cyan|c10=Blue|c11=Violet
|d1=Web colors|d2=Fictional colors|d3=See also|d4=Footnotes|d5=References}}