Шаблон:Collapse/doc: различия между версиями

Материал из Колыбели Солнца
Перейти к навигации Перейти к поиску
en>SMcCandlish
(typo)
en>SMcCandlish
(entity fix (?))
Строка 9: Строка 9:
'''''Note: {{Tl|Collapse}} needs to be substed in order for the time stamp functionality to work properly.'''''
'''''Note: {{Tl|Collapse}} needs to be substed in order for the time stamp functionality to work properly.'''''


{{Tlp|Collapse|1=<var>Discussion text to be put into box.</var>|2=<var>Optional custom heading</var>}}
{{Tlx|Collapse|1&#61;<var>Discussion text to be put into box.</var>|2&#61;<var>Optional custom heading</var>}}


It is definitely safest to use the named {{para|1}} and {{para|2}} parameters, because otherwise any "=" character will break the template.
It is definitely safest to use the named {{para|1}} and {{para|2}} parameters, because otherwise any "=" character will break the template.
Строка 39: Строка 39:
Replace with:
Replace with:


{{Divbox|tt|Changed to|{{Tlsp|Collapse|1={{Lorem ipsum}}|2=[[Help:Section|Heading]]}}}}
{{Divbox|tt|Changed to|{{Tlsp|Collapse|1&#61;{{Lorem ipsum}}|2&#61;[[Help:Section|Heading]]}}}}


===The expand parameter===
===The expand parameter===

Версия 05:12, 12 января 2010

Шаблон:Documentation subpage Шаблон:Shortcut

The Collapse template is used for placing collapse boxes around discussions.

Usage

Note: {{Collapse}} needs to be substed in order for the time stamp functionality to work properly.

{{{{#if: |subst:}}Collapse{{#if:1=Discussion text to be put into box. ||1=Discussion text to be put into box.}}{{#if:2=Optional custom heading ||2=Optional custom heading}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}}

It is definitely safest to use the named |{{SAFESUBST:#if:1|1=}} and |{{SAFESUBST:#if:2|2=}} parameters, because otherwise any "=" character will break the template.

The bg parameter

The bg parameter is Optional. It changes the background color. use Web color values (e.g. #F0F2F5).

Example

{{Collapse|1=Discussion text to be put into box.|bg=#F0F2F5}} creates:

{{{width}}}|auto}}; float: left; clear: left {{{width}}}|auto}}; float: right; clear: right {{{width}}}|auto}}; clear: none centre = margin:0.2em auto; width:{{safesubst:#if:|{{{width}}}|auto}}; clear: both {{{width}}}|100%}}; clear: both

}}; padding: 1px;"

left|{{safesubst:#if:|center|left}}}}; {{safesubst:#if:|color: {{{fc}}};|}}" | Extended content
Discussion text to be put into box.

{{safesubst:#ifeq:%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD||Template:collapse is not available for use in articles (see MOS:COLLAPSE).}}

The padding parameter

The padding parameter adjusts the amount of cell padding (defaults to 8px):

{{Collapse|1=Discussion text to be put into box.|padding=20}} creates:

{{{width}}}|auto}}; float: left; clear: left {{{width}}}|auto}}; float: right; clear: right {{{width}}}|auto}}; clear: none centre = margin:0.2em auto; width:{{safesubst:#if:|{{{width}}}|auto}}; clear: both {{{width}}}|100%}}; clear: both

}}; padding: 1px;"

left|{{safesubst:#if:|center|left}}}}; {{safesubst:#if:|color: {{{fc}}};|}}" | Extended content
Discussion text to be put into box.

{{safesubst:#ifeq:%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD||Template:collapse is not available for use in articles (see MOS:COLLAPSE).}}


Around header text

When used with a section of text, include the section header in the collapsed portion of text. For example, given:Шаблон:Clarify

Шаблон:Divbox

Replace with:

Шаблон:Divbox

The expand parameter

Simply add |{{SAFESUBST:#if:expand|expand=}}yes to have the box show up in expanded form with a "hide" link, instead of collapsed form with a "show" link. Note: |{{SAFESUBST:#if:expand|expand=}}no does not work, which is lame; to disable the feature, you have to remove the entire |{{SAFESUBST:#if:|=}}expand parameter and value.

See also