Difference between revisions of "Template:Sidebar/doc"
(Import from Wikipedia (CC BY-SA license), with changes.) |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
+ | <!-----Edit template documentation below this line-----> | ||
{{High-risk}} | {{High-risk}} | ||
{{En-WP attribution notice}} | {{En-WP attribution notice}} | ||
− | |||
− | |||
This template is a [[w:wikt:Metatemplate|metatemplate]] for the creation of sidebar templates, i.e. boxes that are [[w:Vertical direction|vertically]]-aligned [[Project:Navigation templates|navigation templates]]. Sidebars, like [[w:Wikipedia:Manual of Style/Infoboxes|infoboxes]], are usually positioned on the right-hand side of a page. | This template is a [[w:wikt:Metatemplate|metatemplate]] for the creation of sidebar templates, i.e. boxes that are [[w:Vertical direction|vertically]]-aligned [[Project:Navigation templates|navigation templates]]. Sidebars, like [[w:Wikipedia:Manual of Style/Infoboxes|infoboxes]], are usually positioned on the right-hand side of a page. | ||
Line 14: | Line 13: | ||
<pre style="overflow:auto;"> | <pre style="overflow:auto;"> | ||
{{Sidebar | {{Sidebar | ||
+ | | style = | ||
| name = {{subst:PAGENAME}} | | name = {{subst:PAGENAME}} | ||
| pretitle = | | pretitle = | ||
Line 139: | Line 139: | ||
|- | |- | ||
| {{longitem|{{para|navbar}}{{nowrap|{{nbsp|2}}{{smaller|(or {{para|tnavbar}})}}}}}} | | {{longitem|{{para|navbar}}{{nowrap|{{nbsp|2}}{{smaller|(or {{para|tnavbar}})}}}}}} | ||
− | |style="padding-left:0.5em;"| Set to "off", "none", etc (without quotes) to remove the {{tl|navbar}} links ({{small|{{smallcaps|V{{dot}}T{{dot}}E}}}}) that otherwise appear at the bottom of the sidebar. | + | |style="padding-left:0.5em;"| Set to "off", "none", etc. (without quotes) to remove the {{tl|navbar}} links ({{small|{{smallcaps|V{{dot}}T{{dot}}E}}}}) that otherwise appear at the bottom of the sidebar. |
|- | |- | ||
| {{longitem|{{para|navbarfontstyle}}<br/>{{nbsp|2}}{{smaller|(or {{para|tnavbarfontstyle}})}}}} | | {{longitem|{{para|navbarfontstyle}}<br/>{{nbsp|2}}{{smaller|(or {{para|tnavbarfontstyle}})}}}} | ||
Line 190: | Line 190: | ||
</pre> | </pre> | ||
− | Note in the examples above that the child sidebar is placed in a {{code|content}} field, not a {{code|heading}} field. Notice also that the section subheadings do not appear in bold if this is not explicitly specified. To obtain bold section headings, | + | Note in the examples above that the child sidebar is placed in a {{code|content}} field, not a {{code|heading}} field. Notice also that the section subheadings do not appear in bold if this is not explicitly specified. To obtain bold section headings, move the titles to the {{code|heading}} field, using |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{{Sidebar | {{Sidebar | ||
| title = Top-level title | | title = Top-level title | ||
| heading1 = First subsection | | heading1 = First subsection | ||
+ | | content1 = | ||
{{Sidebar |child=yes | {{Sidebar |child=yes | ||
| heading1 = Heading 1.1 | | heading1 = Heading 1.1 | ||
Line 237: | Line 201: | ||
}} | }} | ||
| heading2 = Second subsection | | heading2 = Second subsection | ||
+ | | content2 = | ||
{{Sidebar |child=yes | {{Sidebar |child=yes | ||
| heading1 = Heading 2.1 | | heading1 = Heading 2.1 | ||
Line 247: | Line 212: | ||
| title = Top-level title | | title = Top-level title | ||
| heading1 = First subsection | | heading1 = First subsection | ||
+ | | content1 = | ||
{{Sidebar |child=yes | {{Sidebar |child=yes | ||
| heading1 = Heading 1.1 | | heading1 = Heading 1.1 | ||
Line 252: | Line 218: | ||
}} | }} | ||
| heading2 = Second subsection | | heading2 = Second subsection | ||
+ | | content2 = | ||
{{Sidebar |child=yes | {{Sidebar |child=yes | ||
| heading1 = Heading 2.1 | | heading1 = Heading 2.1 | ||
Line 259: | Line 226: | ||
}} | }} | ||
</pre> | </pre> | ||
− | |||
− | |||
== Full blank syntax == | == Full blank syntax == | ||
Line 345: | Line 310: | ||
Supplementary related documentation (concerning {{tl|navbar}} use within a sidebar) is at [[Template:Navbar/doc]]. | Supplementary related documentation (concerning {{tl|navbar}} use within a sidebar) is at [[Template:Navbar/doc]]. | ||
+ | |||
+ | == Tracking category == | ||
+ | * {{clc|Pages using sidebar with the child parameter}} | ||
== See also == | == See also == |
Latest revision as of 22:19, 17 April 2018
Error creating thumbnail: /bin/bash: rsvg-convert: command not found |
This is a documentation subpage for Template:Sidebar. It contains usage information, categories and other content that is not part of the original template page. |
Error creating thumbnail: /bin/bash: rsvg-convert: command not found |
This template is used on a very large number of pages. To avoid large-scale disruption and unnecessary server load, any changes to it should first be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can then be added to this page in a single edit. Please consider discussing changes on the talk page before implementing them. |
This template uses material from the Wikipedia template Template:Sidebar/doc, which is released under the Creative Commons Attribution-ShareAlike 3.0 Unported License (view authors). | Error creating thumbnail: /bin/bash: rsvg-convert: command not found |
This template is a metatemplate for the creation of sidebar templates, i.e. boxes that are vertically-aligned navigation templates. Sidebars, like infoboxes, are usually positioned on the right-hand side of a page.
{{Sidebar with collapsible lists}} is a version of {{Sidebar}} that adds collapsibility to its sections, i.e. the means to show or hide sections by clicking links beside their headings.
Contents
Usage
{{{pretitle}}} |
{{{title}}} |
---|
{{{image}}} |
{{{above}}} |
{{{heading}}} |
{{{content}}} |
{{{heading}}} |
{{{content}}} |
{{{heading}}} |
{{{content}}} |
{{{heading}}} |
{{{content}}} |
{{{below}}} |
(parameters with infrequent use omitted)
{{Sidebar | style = | name = {{subst:PAGENAME}} | pretitle = | title = | image = | headingstyle = | contentstyle = | above = | heading1 = | content1 = | heading2 = | content2 = | heading3 = | content3 = <!-- etc, to: --> | heading35 = | content35 = | below = }}
Parameters
No parameters are mandatory, but if the V · T · E {{navbar}} links along the bottom of a {{Sidebar}} are to function correctly (unless their appearance is suppressed; see the navbar parameter below), the parameter name needs to be set (to the name of the sidebar's page).
Principal parameters
Parameter | Explanation |
---|---|
|name=
|
The sidebar's name, i.e. the name following "Template:" in the title shown at the top of the sidebar's page. Required if the V · T · E {{navbar}} links at the bottom of the sidebar are to function correctly, unless their appearance is suppressed (see the navbar parameter below). When {{Sidebar}} is used as a wrapper, setting |name={{subst:PAGENAME}} is recommended.
|
|outertitle=
|
Use to place a title for the sidebar immediately above the sidebar. |
|topimage=
|
Use to place an image at the top of the sidebar, i.e. above |title= (if used). Full wiki syntax is expected (i.e. [[File:...]] ). To add a caption below the image, use |topcaption= .
|
|pretitle=
|
Use to place a line such as "Part of the X series on" before the title. |
|title=
|
Use to place a title for the sidebar at the top of the sidebar. (If |topimage= is used, it will appear immediately below it).
|
|image=
|
Use to place an image between the |title= (if used) and first section. As with |topimage= , full wiki syntax is expected (i.e. [[File:...]] ). To add a caption below the image, use |caption= .
|
|headingstyle=
|
Use to alter the default CSS styling set for section headings. To alter the CSS styling for a specific section's heading, use |headingnstyle= , where n is the number of the section.
|
|contentstyle=
|
Use to alter the default CSS styling set for section content. To alter the CSS styling for a particular section's content, use |contentnstyle= , where n is the number of the section.
|
|heading1= |content1=
|
First section's heading / content. content1 is required if heading1 is also to appear. |
|heading2= |content2=
|
Second section's heading / content. (content2 required if heading2 also to appear; etc.) |
|heading3= |content3=
|
Third section's heading / content. |
...... etc ...... | |
|heading35= |content35=
|
Currently, the last possible section heading and/or content. |
Other parameters
Parameter | Explanation |
---|---|
|above=
|
Same as the |above= offered by {{Navbox}}.
|
|
Microformat classes for the corresponding parameters. |
|below=
|
Same as the |below= offered by {{Navbox}}.(Use, for example, to add one or more portal links to the bottom of the template (shown, by default, in bold).) |
|
Use to alter the default CSS styling for the corresponding parameters. |
|cellspacing= |cellpadding=
|
Use to amend the default cellspacing / cellpadding set for the infobox-class table with which the sidebar is built. |
|navbar= (or |tnavbar= ) |
Set to "off", "none", etc. (without quotes) to remove the {{navbar}} links (V · T · E) that otherwise appear at the bottom of the sidebar. |
|navbarfontstyle= (or |tnavbarfontstyle= ) |
Use to specify the font style used by the navbar at the bottom of the sidebar (see {{navbar}} for options available). |
Handling long links
{{Normalwraplink}} may be used to handle links that should wrap within the sidebar or otherwise need to be made to wrap, in order to prevent the sidebar from becoming too wide. Use {{normalwraplink|longlinkname}}
, where |longlinkname
is the long link without its square brackets.
Use the |wraplinks=true
parameter to turn link wrapping off for the whole template.
Embedding
One sidebar template can be embedded into another using the |child=
parameter. This feature can be used to create a modular sidebar, or to create more well-defined and logical sections.
Top-level title |
---|
First subsection</th> |
Top-level title |
---|
First subsection |
Heading 1.1 |
Content 1.1 |
Second subsection |
Heading 2.1 |
Content 2.1 |
"below" text |
{{Sidebar | title = Top-level title | heading1 = First subsection | content1 = {{Sidebar |child=yes | heading1 = Heading 1.1 | content1 = Content 1.1 }} | heading2 = Second subsection | content2 = {{Sidebar |child=yes | heading1 = Heading 2.1 | content1 = Content 2.1 }} | below = "below" text }}
Full blank syntax
{{{topimage}}} |
{{{pretitle}}} |
{{{title}}} |
---|
{{{image}}} {{{caption}}} |
{{{above}}} |
{{{heading}}} |
{{{content}}} |
{{{heading}}} |
{{{content}}} |
{{{heading}}} |
{{{content}}} |
{{{heading}}} |
{{{content}}} |
{{{below}}} |
(omitting heading4/content4 to penultimate heading/content parameters)
{{Sidebar | name = {{subst:PAGENAME}} | class = <!-- or: | bodyclass = --> | style = <!-- or: | bodystyle = --> | width = | cellspacing = | cellpadding = | wraplinks = <!-- "true" otherwise (default:) omit --> | outertitleclass = | outertitlestyle = | outertitle = | topimageclass = | topimagestyle = | topimage = | topcaptionstyle = | topcaption = | pretitleclass = | pretitlestyle = | pretitle = | titleclass = | title = | imageclass = | imagestyle = | image = | captionstyle = | caption = | headingclass = | headingstyle = | contentclass = | contentstyle = | aboveclass = | abovestyle = | above = | heading1style = | heading1 = | content1style = | content1 = | heading2style = | heading2 = | content2style = | content2 = | heading3style = | heading3 = | content3style = | content3 = <!-- etc, to: --> | heading35style = | heading35 = | content35style = | content35 = | belowclass = | belowstyle = | below = | navbarstyle = <!-- or: | tnavbarstyle = --> | navbarfontstyle = <!-- or: | tnavbarfontstyle = --> | navbar = <!-- or: | tnavbar = --> <!-- "off", "none", etc otherwise (default:) omit --> }}
Supplementary documentation
Supplementary related documentation (concerning {{navbar}} use within a sidebar) is at Template:Navbar/doc.
Tracking category
See also
- Last pre-Lua version
- {{Sidebar with collapsible lists}}
- {{Infobox}}
- w:Wikipedia:UBLIST, for help using unbulleted lists within content.