Difference between revisions of "Template:Compact ToC"
Jump to navigation
Jump to search
(Update via sandbox/testcases (more flexible parameter values, {{{title}}}/{{{titlepadding}}})) |
|||
Line 1: | Line 1: | ||
__NOTOC__<!-- | __NOTOC__<!-- | ||
− | -->{{# | + | If required, centere the template's output: |
− | <div style="text-align:center;"> | + | -->{{#if:{{{center|{{#ifeq:{{{1|}}}|short1|true}}}}} <!--(i.e. if {{{center}}} set or {{{1}}}="short1")--> |
− | + | | <div style="text-align:center;"> | |
+ | }}<!-- | ||
− | Start contents box | + | Start contents box: |
+ | --><div id="toc" class="toc plainlinks hlist" <!--(Start contents box)--> | ||
+ | style="{{#if:{{{center|{{#ifeq:{{{1|}}}|short1|true}}}}} |margin-left:auto;margin-right:auto; | ||
+ | | {{#if:{{{right|}}} |clear:right;float:right;}} | ||
+ | }} text-align:{{{align|left}}};"><!-- | ||
− | + | Insert {{{title}}}/{{{name}}} otherwise "Contents" ({{MediaWiki:Toc}}): | |
− | + | -->{{#switch:{{{title|{{{name|}}}}}} |omit|none|off|false|no= | |
− | + | | #default = <div id="toctitle" style="text-align:center;{{#if:{{{side|{{#ifeq:{{{1|}}}|short1|true}}}}} |display:inline-block;}}"><!-- | |
− | + | --><span style="{{#if:{{{side|{{#ifeq:{{{1|}}}|short1|true}}}}} |padding:{{{titlepadding|0 0.25em 0 0}}};}}font-weight:bold;"><!-- | |
− | <!-- | + | -->{{{title|{{{name|{{MediaWiki:Toc}}}}}}}} <!-- |
+ | --></span><!-- | ||
+ | --></div><!-- | ||
+ | -->}}<!-- | ||
− | + | Insert links: | |
− | + | --><div style="margin:auto;white-space:nowrap;{{#if:{{{side|{{#ifeq:{{{1|}}}|short1|true}}}}} |display:inline-block;}}"><!-- | |
− | + | -->{{#if:{{{top|}}} | | |
− | + | * [[#top|Top]] }}<!-- | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | -->{{# | ||
− | * [[#top|Top]]}}<!-- | ||
-->{{#if:{{{pre1|{{{preSec1|}}}}}} | | -->{{#if:{{{pre1|{{{preSec1|}}}}}} | | ||
* [[{{{pre1link|{{{preSec1link|#{{{pre1|{{{preSec1}}} }}} }}} }}}|{{{pre1name|{{{preSec1name|{{{pre1|{{{preSec1}}} }}} }}} }}}]] <!-- | * [[{{{pre1link|{{{preSec1link|#{{{pre1|{{{preSec1}}} }}} }}} }}}|{{{pre1name|{{{preSec1name|{{{pre1|{{{preSec1}}} }}} }}} }}}]] <!-- | ||
Line 43: | Line 41: | ||
* [[{{{pre8link|{{{preSec8link|#{{{pre8|{{{preSec8}}} }}} }}} }}}|{{{pre8name|{{{preSec8name|{{{pre8|{{{preSec8}}} }}} }}} }}}]] <!-- | * [[{{{pre8link|{{{preSec8link|#{{{pre8|{{{preSec8}}} }}} }}} }}}|{{{pre8name|{{{preSec8name|{{{pre8|{{{preSec8}}} }}} }}} }}}]] <!-- | ||
-->}} {{#if:{{{prebreak|}}} |{{{prebreak}}}</ul>}} <!-- | -->}} {{#if:{{{prebreak|}}} |{{{prebreak}}}</ul>}} <!-- | ||
− | -->{{# | + | -->{{#if:{{{sym|}}} | |
− | * [[#!$@|!$@]] }}<!-- | + | * [[#!$@|!$@]] }}<!-- -->{{#if:{{{num|}}} | |
− | -->{{# | ||
* {{{0-9|[[#0–9|0–9]]}}} }}<!-- | * {{{0-9|[[#0–9|0–9]]}}} }}<!-- | ||
− | -->{{# | + | -->{{#if:{{{symnum|}}} | |
− | * [[#!–9|!–9]] }}{{# | + | * [[#!–9|!–9]] }}<!-- |
+ | -->{{#switch:{{{letters|}}} |omit|none|false|off|no= | ||
+ | | | ||
* {{{a|[[#A|A]]}}} | * {{{a|[[#A|A]]}}} | ||
* {{{b|[[#B|B]]}}} | * {{{b|[[#B|B]]}}} | ||
Line 74: | Line 73: | ||
* {{{x|[[#X|X]]}}} | * {{{x|[[#X|X]]}}} | ||
* {{{y|[[#Y|Y]]}}} | * {{{y|[[#Y|Y]]}}} | ||
− | * {{{z|[[#Z|Z]]}}}}} <!-- | + | * {{{z|[[#Z|Z]]}}}<!-- |
− | -->{{# | + | -->}}<!--(end #switch:{{{letters|}}}) |
− | + | -->{{#if:{{{nobreak|{{#ifeq:{{{1|}}}|short1|true}}}}} | |</ul>}}<!-- | |
− | |||
− | -->{{#if:{{{custom1|{{{Sec1|}}}}}} | | + | Insert custom links: |
+ | -->{{#if:{{{custom1|{{{Sec1|}}}}}} | | ||
* [[{{{custom1link|{{{Sec1link|#{{{custom1|{{{Sec1}}} }}} }}} }}}|{{{custom1name|{{{Sec1name|{{{custom1|{{{Sec1}}} }}} }}} }}}]] <!-- | * [[{{{custom1link|{{{Sec1link|#{{{custom1|{{{Sec1}}} }}} }}} }}}|{{{custom1name|{{{Sec1name|{{{custom1|{{{Sec1}}} }}} }}} }}}]] <!-- | ||
− | -->}} {{#if:{{{custom2|{{{Sec2|}}}}}} | | + | -->}} {{#if:{{{custom2|{{{Sec2|}}}}}} | |
* [[{{{custom2link|{{{Sec2link|#{{{custom2|{{{Sec2}}} }}} }}} }}}|{{{custom2name|{{{Sec2name|{{{custom2|{{{Sec2}}} }}} }}} }}}]] <!-- | * [[{{{custom2link|{{{Sec2link|#{{{custom2|{{{Sec2}}} }}} }}} }}}|{{{custom2name|{{{Sec2name|{{{custom2|{{{Sec2}}} }}} }}} }}}]] <!-- | ||
− | + | -->}} {{#if:{{{custom3|{{{Sec3|}}}}}} | | |
* [[{{{custom3link|{{{Sec3link|#{{{custom3|{{{Sec3}}} }}} }}} }}}|{{{custom3name|{{{Sec3name|{{{custom3|{{{Sec3}}} }}} }}} }}}]] <!-- | * [[{{{custom3link|{{{Sec3link|#{{{custom3|{{{Sec3}}} }}} }}} }}}|{{{custom3name|{{{Sec3name|{{{custom3|{{{Sec3}}} }}} }}} }}}]] <!-- | ||
− | + | -->}} {{#if:{{{custom4|{{{Sec4|}}}}}} | | |
* [[{{{custom4link|{{{Sec4link|#{{{custom4|{{{Sec4}}} }}} }}} }}}|{{{custom4name|{{{Sec4name|{{{custom4|{{{Sec4}}} }}} }}} }}}]] <!-- | * [[{{{custom4link|{{{Sec4link|#{{{custom4|{{{Sec4}}} }}} }}} }}}|{{{custom4name|{{{Sec4name|{{{custom4|{{{Sec4}}} }}} }}} }}}]] <!-- | ||
− | + | -->}} {{#if:{{{custom5|{{{Sec5|}}}}}} | | |
* [[{{{custom5link|{{{Sec5link|#{{{custom5|{{{Sec5}}} }}} }}} }}}|{{{custom5name|{{{Sec5name|{{{custom5|{{{Sec5}}} }}} }}} }}}]] <!-- | * [[{{{custom5link|{{{Sec5link|#{{{custom5|{{{Sec5}}} }}} }}} }}}|{{{custom5name|{{{Sec5name|{{{custom5|{{{Sec5}}} }}} }}} }}}]] <!-- | ||
− | + | -->}} {{#if:{{{custom6|{{{Sec6|}}}}}} | | |
* [[{{{custom6link|{{{Sec6link|#{{{custom6|{{{Sec6}}} }}} }}} }}}|{{{custom6name|{{{Sec6name|{{{custom6|{{{Sec6}}} }}} }}} }}}]] <!-- | * [[{{{custom6link|{{{Sec6link|#{{{custom6|{{{Sec6}}} }}} }}} }}}|{{{custom6name|{{{Sec6name|{{{custom6|{{{Sec6}}} }}} }}} }}}]] <!-- | ||
− | + | -->}} {{#if:{{{custom7|{{{Sec7|}}}}}} | | |
* [[{{{custom7link|{{{Sec7link|#{{{custom7|{{{Sec7}}} }}} }}} }}}|{{{custom7name|{{{Sec7name|{{{custom7|{{{Sec7}}} }}} }}} }}}]] <!-- | * [[{{{custom7link|{{{Sec7link|#{{{custom7|{{{Sec7}}} }}} }}} }}}|{{{custom7name|{{{Sec7name|{{{custom7|{{{Sec7}}} }}} }}} }}}]] <!-- | ||
− | + | -->}} {{#if:{{{custom8|{{{Sec8|}}}}}} | | |
* [[{{{custom8link|{{{Sec8link|#{{{custom8|{{{Sec8}}} }}} }}} }}}|{{{custom8name|{{{Sec8name|{{{custom8|{{{Sec8}}} }}} }}} }}}]] <!-- | * [[{{{custom8link|{{{Sec8link|#{{{custom8|{{{Sec8}}} }}} }}} }}}|{{{custom8name|{{{Sec8name|{{{custom8|{{{Sec8}}} }}} }}} }}}]] <!-- | ||
− | + | -->}}<!-- | |
− | + | Insert "See also" etc links: | |
− | + | -->{{#if:{{{seealso|}}} | | |
− | -->{{# | ||
* [[#See also|See also]] }}<!-- | * [[#See also|See also]] }}<!-- | ||
− | -->{{# | + | -->{{#if:{{{notesfirst|}}} | |
* [[#Notes|Notes]] }}<!-- | * [[#Notes|Notes]] }}<!-- | ||
− | -->{{#ifeq:{{{refs|{{#ifeq:{{{1}}}|short1| | + | -->{{#ifeq:{{{refs|{{#ifeq:{{{1|}}}|short1|true}}}}} | |
* [[#References|References]] }}<!-- | * [[#References|References]] }}<!-- | ||
− | -->{{# | + | -->{{#if:{{{notes|}}} | |
* [[#Notes|Notes]] }}<!-- | * [[#Notes|Notes]] }}<!-- | ||
− | -->{{# | + | -->{{#if:{{{further|}}} | |
* [[#Further reading|Further reading]] }}<!-- | * [[#Further reading|Further reading]] }}<!-- | ||
− | -->{{# | + | -->{{#if:{{{extlinks|}}} | |
− | * [[#External links|External links]] | + | * [[#External links|External links]] }}<!-- |
− | |||
− | |||
− | + | --></div><!--(end links div) | |
− | + | --></div><!--(end contents-box div) | |
− | -->{{#ifeq:{{{center|{{#ifeq:{{{1}}}|short1| | + | End centering div (if used): |
− | </div><!-- | + | -->{{#ifeq:{{{center|{{#ifeq:{{{1|}}}|short1|true}}}}} |
+ | | </div><!-- | ||
-->}}<noinclude> | -->}}<noinclude> | ||
− | |||
{{Documentation}} | {{Documentation}} | ||
</noinclude> | </noinclude> |