Difference between revisions of "Template:Collapse top"

Jump to navigation Jump to search
translation tweaks
>Verdy p
>Shirayuki
(translation tweaks)
Line 1: Line 1:
<noinclude><languages />
<noinclude><languages />
</noinclude>{{#switch: <translate></translate>
</noinclude>{{#switch: <translate></translate>
| = <div style="display:{{{display|block}}};margin-{{dir|{{pagelang}}|right|left}}:{{{indent|0}}};{{{extrastyle|}}}"><!-- NOTE: width renders incorrectly if added to main STYLE section
| = <!--
--><div style="display:{{{display|block}}};margin-{{dir|{{pagelang}}|right|left}}:{{{indent|0}}};{{{extrastyle|}}}"><!-- NOTE: width renders incorrectly if added to main STYLE section
   --><table class="navbox mw-collapsible {{#if:{{{expand|}}}
   --><table class="navbox mw-collapsible {{#if:{{{expand|}}}
   || mw-collapsed
   || mw-collapsed
Line 17: Line 18:
   }}<!--
   }}<!--
   --><tr><td style="font-size:112%;background:{{{bg2|white}}};border:solid {{{border2|1px silver}}};padding:{{{padding|8px}}}">
   --><tr><td style="font-size:112%;background:{{{bg2|white}}};border:solid {{{border2|1px silver}}};padding:{{{padding|8px}}}">
|#default = {{#invoke:Template translation|renderTranslatedTemplate|template=Template:Collapse top|noshift=1}}
|#default =<!--
-->{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Collapse top|noshift=1}}
}}<noinclude>
}}<noinclude>
<div style="width:100%;text-align:center">''<translate><!--T:4--> The following content has been placed in a collapsed box for improved usability.</translate>''</div>
<div style="width:100%;text-align:center">''<translate><!--T:4--> The following content has been placed in a collapsed box for improved usability.</translate>''</div>
{{Collapse bottom}}
{{Collapse bottom}}
{{Documentation|content=
{{Documentation|content=
<translate>The {{Tlx|Collapse top}} template, and its paired template {{Tlx|Collapse bottom}}, are used for placing a collapse box around a talk page discussion.
<translate>
The <tvar|1>{{Tlx|Collapse top}}</> template, and its paired template <tvar|2>{{Tlx|Collapse bottom}}</>, are used for placing a collapse box around a talk page discussion.


== Usage == <!--T:8-->
== Usage == <!--T:8-->
Place {{Tlx|Collapse top}} and {{Tlx|Collapse bottom}} around the text to be collapsed. For example:
</translate>
</translate>
<translate>Place <tvar|1>{{Tlx|Collapse top}}</> and <tvar|2>{{Tlx|Collapse bottom}}</> around the text to be collapsed.</translate>
<translate>For example:</translate>


<syntaxhighlight lang="html5">
<syntaxhighlight lang="html5">
Line 35: Line 38:
</syntaxhighlight>
</syntaxhighlight>


<translate>produces:</translate>
<translate>
produces:
</translate>


{{Collapse top|title=This is the title text}}
{{Collapse top|title=This is the title text}}
Line 41: Line 46:
{{Collapse bottom}}
{{Collapse bottom}}


<translate><tvar|1>{{Tlx|Collapse bottom}}</> should always be placed on its own line.
<translate>
<tvar|1>{{Tlx|Collapse bottom}}</> should always be placed on its own line.


== Parameters == <!--T:9-->
== Parameters == <!--T:9-->
 
</translate>
This template takes the following parameters, all of which are optional. They are case-sensitive. Those that take CSS measurements require them in CSS format (e.g. <tvar|1><code style="color: #006400">1em</code></> not <tvar|2><code style="color:#8B0000">1&nbsp;em</code></>.</translate>
<translate>This template takes the following parameters, all of which are optional.</translate>
<translate>They are case-sensitive.</translate>
<translate>Those that take CSS measurements require them in CSS format (e.g. <tvar|1><code style="color: #006400">1em</code></> not <tvar|2><code style="color:#8B0000">1&nbsp;em</code></>.</translate>


; {{Para|1}} <span style="font-weight:normal"><translate>(or first unnamed parameter)</translate></span>, {{Para|title}}, {{Para|reason}}, {{Para|header}}, {{Para|heading}}
; {{Para|1}} <span style="font-weight:normal"><translate>(or first unnamed parameter)</translate></span>, {{Para|title}}, {{Para|reason}}, {{Para|header}}, {{Para|heading}}
: <translate>Will give the collapsed box a title, which occurs on the same line as the ''show'' link and is always visible. It defaults to "Extended content".</translate>
: <translate>Will give the collapsed box a title, which occurs on the same line as the ''show'' link and is always visible.</translate> <translate>It defaults to "Extended content".</translate>
: <translate>For example, <tvar|1><code><nowiki>{{Collapse top|title=This is the title text}}</nowiki></code></> or <tvar|2><code><nowiki>{{Collapse top|This is the title text}}</nowiki></code></>. Note: The shorter, unnamed markup will not work if the title value contain an equals (<tvar|3><code>=</code></>) character.</translate>
: <translate>For example, <tvar|1><code><nowiki>{{Collapse top|title=This is the title text}}</nowiki></code></> or <tvar|2><code><nowiki>{{Collapse top|This is the title text}}</nowiki></code></>.</translate> <translate>Note: The shorter, unnamed markup will not work if the title value contain an equals (<tvar|1><code>=</code></>) character.</translate>
; {{Para|warning|yes}}
; {{Para|warning|yes}}
: <translate>Will display a default warning line under the main title which reads "The following is a closed debate. {{<tvar|1>Strong|style=color:red</>|Please do not modify it.}}"</translate>
: <translate>Will display a default warning line under the main title which reads "The following is a closed debate.</translate> <translate>{{<tvar|1>Strong|style=color:red</>|Please do not modify it.}}"</translate>
: <translate>Any non-empty value supplied to this parameter will have this effect (i.e. <tvar|2>{{Para|warning|<span style="color:red">no</span>}}</> will not work as expected).</translate>
: <translate>Any non-empty value supplied to this parameter will have this effect (i.e. <tvar|1>{{Para|warning|<span style="color:red">no</span>}}</> will not work as expected).</translate>
; {{Para|2}} <span style="font-weight:normal"><translate>(or second unnamed parameter)</translate></span>
; {{Para|2}} <span style="font-weight:normal"><translate>(or second unnamed parameter)</translate></span>
: <translate>This is optional warning-line text. It will override the standard warning line above; it is not necessary to also use <tvar|1>{{Para|warning|yes}}</> in this case, though doing so is harmless.</translate>
: <translate>This is optional warning-line text.</translate> <translate>It will override the standard warning line above; it is not necessary to also use <tvar|1>{{Para|warning|yes}}</> in this case, though doing so is harmless.</translate>
; {{Para|left|yes}}
; {{Para|left|yes}}
: <translate>Will align the title along the left margin (in RTL languages, along the right margin instead).</translate>
: <translate>Will align the title along the left margin (in RTL languages, along the right margin instead).</translate>
Line 60: Line 68:
: <translate>Any non-empty value supplied to this parameter will have this effect (i.e. <tvar|1>{{Para|left|<span style="color:#8B0000">no</span>}}</> will not work as expected).</translate>
: <translate>Any non-empty value supplied to this parameter will have this effect (i.e. <tvar|1>{{Para|left|<span style="color:#8B0000">no</span>}}</> will not work as expected).</translate>
; {{Para|expand|yes}}
; {{Para|expand|yes}}
: <translate>Will leave the material uncollapsed with the border and coloring. Default is to collapse the material. </translate>
: <translate>Will leave the material uncollapsed with the border and coloring.</translate> <translate>Default is to collapse the material.</translate>
: <translate>Any non-empty value supplied to this parameter will have this effect (i.e. <tvar|1>{{Para|expand|<span style="color:#8B0000">no</span>}}</> will not work as expected).</translate>
: <translate>Any non-empty value supplied to this parameter will have this effect (i.e. <tvar|1>{{Para|expand|<span style="color:#8B0000">no</span>}}</> will not work as expected).</translate>
; {{Para|bg}}
; {{Para|bg}}
: <translate>Sets the background color of the title of the collapsible bar. Defaults to "#F8FCFF", a whitish color. Named colors are listed at [[List of colors]].</translate>
: <translate>Sets the background color of the title of the collapsible bar.</translate> <translate>Defaults to "<tvar|1>#F8FCFF</>", a whitish color.</translate> <translate>Named colors are listed at [[List of colors]].</translate>
: <translate>For example, <tvar|1><code><nowiki>{{Collapse top|This is the title text|bg=#008000}}</nowiki></code></> or <tvar|2><code><nowiki>{{Collapse top|This is the title text|bg=green}}</nowiki></code></> (numeric HTML color codes require the leading <tvar|H><code>#</code></>).</translate>
: <translate>For example, <tvar|1><code><nowiki>{{Collapse top|This is the title text|bg=#008000}}</nowiki></code></> or <tvar|2><code><nowiki>{{Collapse top|This is the title text|bg=green}}</nowiki></code></> (numeric HTML color codes require the leading <tvar|H><code>#</code></>).</translate>
; {{Para|fc}}
; {{Para|fc}}
: <translate>Sets the font color of the title of the collapsible bar. Defaults to "black".</translate>
: <translate>Sets the font color of the title of the collapsible bar.</translate> <translate>Defaults to "<tvar|1>black</>".</translate>
: <translate>See <tvar|bg>{{Para|bg}}</>, above, for details on color options.</translate>
: <translate>See <tvar|bg>{{Para|bg}}</>, above, for details on color options.</translate>
; {{Para|border}}
; {{Para|border}}
: <translate>Sets the width of the border line on the collapsed material. Defaults to <code>1px</code>.</translate>
: <translate>Sets the width of the border line on the collapsed material.</translate> <translate>Defaults to <tvar|1><code>1px</code></>.</translate>
: <translate>For example, <tvar|1><code><nowiki>{{Collapse top|border=2px}}</nowiki></code></>; going much thicker than this is not very useful.</translate>
: <translate>For example, <tvar|1><code><nowiki>{{Collapse top|border=2px}}</nowiki></code></>; going much thicker than this is not very useful.</translate>
; {{Para|b-color}}
; {{Para|b-color}}
: <translate>Sets the border color. Defaults to <tvar|1><code>silver</code></> (<tvar|2><code>#C0C0C0</code></>).</translate>
: <translate>Sets the border color.</translate> <translate>Defaults to <tvar|1><code>silver</code></> (<tvar|2><code>#C0C0C0</code></>).</translate>
: <translate>See <tvar|bg>{{Para|bg}}</>, above, for details on color options.</translate>
: <translate>See <tvar|bg>{{Para|bg}}</>, above, for details on color options.</translate>
; {{Para|padding}}
; {{Para|padding}}
: <translate>Sets the padding (distance from borders) on the collapsed material inside the colored area. Defaults to <tvar|1><code>8px</code></>.</translate>
: <translate>Sets the padding (distance from borders) on the collapsed material inside the colored area.</translate> <translate>Defaults to <tvar|1><code>8px</code></>.</translate>
; {{Para|width}}
; {{Para|width}}
: <translate>Sets the width of the overall template relative to the page (or a block element containing the collapse box). This should virtually always be given as a percentage, e.g. <tvar|1>{{Para|width|50%}}</>, or in relative <tvar|2><code>em</code></> units, e.g. <tvar|3>{{Para|width|30em}}</>. Pixel-based values should be avoided, as they are effectively meaningless – the result will be different depending on each user's browser and local CSS settings (which browser and operating system it is, zoom level, font sizes, etc.).</translate>
: <translate>Sets the width of the overall template relative to the page (or a block element containing the collapse box).</translate> <translate>This should virtually always be given as a percentage, e.g. <tvar|1>{{Para|width|50%}}</>, or in relative <tvar|2><code>em</code></> units, e.g. <tvar|3>{{Para|width|30em}}</>.</translate> <translate>Pixel-based values should be avoided, as they are effectively meaningless – the result will be different depending on each user's browser and local CSS settings (which browser and operating system it is, zoom level, font sizes, etc.).</translate>
; {{Para|border2}}
; {{Para|border2}}
: <translate>Sets the properties of the border of the box that appears when template is expanded. Defaults to <code>1px silver</code> (there is no provision to change from a solid line).</translate>
: <translate>Sets the properties of the border of the box that appears when template is expanded.</translate> <translate>Defaults to <tvar|1><code>1px silver</code></> (there is no provision to change from a solid line).</translate>
: <translate>For example, <tvar|1><code><nowiki>{{Collapse top|border2=2px}}</nowiki></code></> (only width or color will be changed if only one value is supplied).</translate>
: <translate>For example, <tvar|1><code><nowiki>{{Collapse top|border2=2px}}</nowiki></code></> (only width or color will be changed if only one value is supplied).</translate>
: <translate>See <tvar|bg>{{Para|bg}}</>, above, for details on color options.</translate>
: <translate>See <tvar|bg>{{Para|bg}}</>, above, for details on color options.</translate>
Line 86: Line 94:
: <translate>See <tvar|bg>{{Para|bg}}</>, above, for details on color options.</translate>
: <translate>See <tvar|bg>{{Para|bg}}</>, above, for details on color options.</translate>
; {{Para|indent}}
; {{Para|indent}}
: <translate>Indents the box from the left of the page. Defaults to no indentation. Each <tvar|1><code>:</code></> in talk page markup is approximately equivalent to <tvar|2><code>1.6em</code></> of indent (e.g., to match <tvar|3><code>::::</code></> indentation level, use <tvar|4>{{Para|indent|6.4em}}</>. You can also use a percentage value.</translate>
: <translate>Indents the box from the left of the page.</translate> <translate>Defaults to no indentation.</translate> <translate>Each <tvar|1><code>:</code></> in talk page markup is approximately equivalent to <tvar|2><code>1.6em</code></> of indent (e.g., to match <tvar|3><code>::::</code></> indentation level, use <tvar|4>{{Para|indent|6.4em}}</>.</translate> <translate>You can also use a percentage value.</translate>
: <translate>Pixel-based values should be avoided (see <tvar|5>{{Para|width}}</>, above, for the reason).</translate>
: <translate>Pixel-based values should be avoided (see <tvar|1>{{Para|width}}</>, above, for the reason).</translate>


<translate>
<translate>
Line 135: Line 143:
{{Collapse bottom}}</syntaxhighlight>
{{Collapse bottom}}</syntaxhighlight>


<translate>must be rewritten as:</translate>
<translate>
must be rewritten as:
</translate>


<syntaxhighlight lang="html5">{{Collapse top|Section header}}
<syntaxhighlight lang="html5">{{Collapse top|Section header}}
Line 141: Line 151:
{{Collapse bottom}}</syntaxhighlight>
{{Collapse bottom}}</syntaxhighlight>


<translate>The end result:</translate>
<translate>
The end result:
</translate>


{{Collapse top|Section header}}
{{Collapse top|Section header}}
Anonymous user

Navigation menu