Changes

Jump to navigation Jump to search
11,378 bytes added ,  20:06, 7 February 2014
m
1 revision
{{documentation subpage}}

This template is intended to be a [[wikt:metatemplate|metatemplate]] for sidebar templates, which are [[Vertical direction|vertically]]-aligned [[Wikipedia:Navigation templates|navigation templates]]. The sidebar is usually positioned on the right-hand side of a page, in the same way as the {{tlx|infobox}} template is aligned for [[Wikipedia:Manual of Style/Infoboxes|infoboxes]].

{{tl|Sidebar with collapsible lists}} adds collapsibility to a sidebar's sections, i.e., the means to show or hide sections by clicking links beside their headings.

== Usage ==
{{Sidebar
| name = {{PAGENAME}}
| outertitle = {{{outertitle}}}
| topimage = {{{topimage}}}
| topcaption = {{{topcaption}}}
| pretitle = {{{pretitle}}}
| title = {{{title}}}
| image = {{{image}}}
| above = {{{above}}}
| heading1 = {{{heading1}}}
| content1 = {{{content1}}}
| heading2 = {{{heading2}}}
| content2 = {{{content2}}}
| heading3 = {{{heading3}}}
| content3 = {{{content3}}}
| content4 = ... up to 35th ...
| heading35 = {{{heading35}}}
| content35 = {{{content35}}}
| below = {{{below}}}
}}

(parameters with infrequent use omitted)
<pre style="overflow:auto;">
{{Sidebar
| name = {{subst:PAGENAME}}
| outertitle =
| topimage =
| pretitle =
| title =
| image =

| headingstyle =
| contentstyle =

| heading1 =
| content1 =

| heading2 =
| content2 =

| heading3 =
| content3 =

<!--...up to 35th:-->

| heading35 =
| content35 =

}}
</pre>

== Parameters ==
No parameters are required unless {{tl|navbar}} links ({{small|V - T - E}}) are to appear at the bottom of the sidebar, in which case the {{para|name}} parameter is needed (see entry in the table immediately below).

=== Principal ===
{| class="wikitable" style="line-height: 1.4em;"
! style="width: 7.0em;" | Parameter !! Explanation
|- style="vertical-align: top;"
| {{para|name}}
| The sidebar's name, i.e., the name following "Template:" in the page's name. Required for the {{tl|navbar}} links at the bottom of the sidebar to function correctly, unless these are omitted (see {{para|navbar}} at the bottom of this table). It is recommended to use ''<nowiki>{{subst:PAGENAME}}</nowiki>'' for this field.
|- style="vertical-align: top;"
| {{para|outertitle}}
| Use to place a title for the sidebar immediately above the sidebar.
|- style="vertical-align: top;"
| {{para|topimage}}
| Use to place an image at the top of the sidebar, i.e., above any {{para|title}} included.<br />
Full wikisyntax expected (i.e., <code><nowiki>[[File:...]]</nowiki></code>).<br />
To add a caption below the image, use {{para|topcaption}}.
|- style="vertical-align: top;"
| {{para|pretitle}}
| Use to place a line such as "Part of the ''X'' series on" before the title.
|- style="vertical-align: top;"
| {{para|title}}
| Use to place a title for the sidebar at the top of the sidebar (immediately below the {{para|topimage}}, if used).
|- style="vertical-align: top;"
| {{para|image}}
| Use to place an image between the {{para|title}} (if used) and first section.<br />
As with {{para|topimage}}, full wikisyntax expected (i.e., <code><nowiki>[[File:...]]</nowiki></code>).<br />
To add a caption below the image, use {{para|caption}}.
|- style="vertical-align: top;"
| {{para|headingstyle}}
| Use to alter the default [[Help:Cascading Style Sheets|CSS]] styling set for section headings.<br />
To alter the CSS styling for a specific section's heading, use {{para|heading<sub>n</sub>style}}, where ''n'' is the number of the section.
|- style="vertical-align: top;"
| {{para|contentstyle}}
| Use to alter the default CSS styling set for section content.<br />
To alter the CSS styling for a particular section's content, use {{para|content<sub>n</sub>style}}, where ''n'' is the number of the section.
|- style="vertical-align: top;"
| {{para|heading1}} || First section's heading (if needed).
|-
| {{para|'''content1'''}} || First section's content (required).
|- style="vertical-align: top;"
| {{para|heading2}} || Second section's heading (if needed).
|-
| {{para|content2}} || Second section's content (if needed).
|- style="vertical-align: top;"
| {{para|heading3}} || Third section's heading (if needed).
|-
| {{para|content3}} || Third section's content (if needed).
|-
| colspan="2" | ...... etc ......
|-
| {{para|heading35}} || rowspan="2" | Currently, the last possible section heading and/or content (if needed).
|-
| {{para|content35}}
|}

=== Other parameters ===
{| class="wikitable plainlist" style="line-height: 1.4em;"
! style="width: 10.0em;" | Parameter !! Explanation
|- style="vertical-align: top;"
| {{para|above}}
| Corresponds to {{para|above}} offered by {{tl|navbox}}.
|-
|
*{{para|bodyclass}} (or {{para|class}})
*{{para|outertitleclass}}
*{{para|topimageclass}}
*{{para|pretitleclass}}
*{{para|titleclass}}
*{{para|imageclass}}
*{{para|aboveclass}}
*{{para|headingclass}}
*{{para|contentclass}}
*{{para|belowclass}}
|
[[Wikipedia:WikiProject Microformats#What are microformats?|Microformat]] classes for the corresponding parameters.<br />
({{para|bodyclass}} (or {{para|class}}) applies to the sidebar as a whole.)
|- style="vertical-align: top;"
| {{para|below}}
| Use to, e.g., add one or more portal links to the bottom of the template (by default in bold).
|-
|
*{{para|bodystyle}} (or {{para|style}})
*{{para|outertitlestyle}}
*{{para|topimagestyle}}
*{{para|topcaptionstyle}}
*{{para|pretitlestyle}}
*{{para|titlestyle}}
*{{para|imagestyle}}
*{{para|captionstyle}}
*{{para|abovestyle}}
*{{para|headingstyle}}
*{{para|heading<sub>n</sub>style}}
*{{para|contentstyle}}
*{{para|content<sub>n</sub>style}}
*{{para|belowstyle}}
*{{para|navbarstyle}} (or {{para|tnavbarstyle}})
|
Use to alter default [[Help:Cascading Style Sheets|CSS]] styling for the corresponding parameters.<br />
({{para|bodystyle}} (or {{para|style}}) applies to the sidebar as a whole.)
|- style="vertical-align: top;"
| {{para|cellspacing}}
| Use to amend the default cellspacing set for the infobox-class table with which the sidebar is built.
|- style="vertical-align: top;"
| {{para|cellpadding}}
| Ditto the default cellpadding.
|- style="vertical-align: top;"
| {{para|navbar}} (or {{para|tnavbar}})
| Set to "none" (without the quotes) to remove the {{tl|navbar}} links appearing at the bottom of the sidebar.
|- style="vertical-align: top;"
| {{para|navbarfontstyle}} (or {{para|tnavbarfontstyle}})
| Use to specify the font style used by the navbar at the bottom of the sidebar (see {{tl|navbar}} for options available).
|}

== Handling long links ==
{{tl|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 {{tlx|normalwraplink|''longlinkname''}}, where {{para||''longlinkname''}} is the long link without its square brackets.

Use the {{para|wraplinks|true}} parameter to turn link wrapping off for the whole template.

==Embedding==
One sidebar template can be embedded into another using the {{para|child}} parameter. This feature can be used to create a modular sidebar, or to create more well-defined and logical sections.
{{sidebar
| title = Top level title
| content1 = {{sidebar
| child = yes
| title = First subsection
| heading1 = Heading 1.1
| content1 = Content 1.1
}}
| content2 = {{sidebar
| child = yes
| title = Second subsection
| heading1 = Heading 2.1
| content1 = Content 2.1
}}
|belowstyle =
|below = Below text
}}
<pre style="overflow:auto">
{{sidebar
| title = Top level title
| content1 = {{sidebar
| child = yes
| title = First subsection
| heading1 = Heading 1.1
| content1 = Content 1.1
}}
| content2 = {{sidebar
| child = yes
| title = Second subsection
| heading1 = Heading 2.1
| content1 = Content 2.1
}}
|belowstyle =
|below = Below text
}}
</pre>
Note, in the examples above, the child infobox is placed in a <code>content</code> field, not a <code>heading</code> field. Notice that the section subheadings are not in bold font if bolding is not explicitly specified. To obtain bold section headings, place the child infobox in a <code>heading</code> field, either using
{{sidebar
| title = Top level title
| heading1 = {{sidebar
| child = yes
| title = First subsection
| heading1 = Heading 1.1
| content1 = Content 1.1
}}
| heading2 = {{sidebar
| child = yes
| title = Second subsection
| heading1 = Heading 2.1
| content1 = Content 2.1
}}
|belowstyle =
|below = Below text
}}
<pre style="overflow:auto">
{{sidebar
| title = Top level title
| heading1 = {{sidebar
| child = yes
| title = First subsection
| heading1 = Heading 1.1
| content1 = Content 1.1
}}
| heading2 = {{sidebar
| child = yes
| title = Second subsection
| heading1 = Heading 2.1
| content1 = Content 2.1
}}
|belowstyle =
|below = Below text
}}
</pre>
or,
{{sidebar
| title = Top level title
| heading1 = First subsection {{sidebar
| child = yes
| heading1 = Heading 1.1
| content1 = Content 1.1
}}
| heading2 = Second subsection {{sidebar
| child = yes
| heading1 = Heading 2.1
| content1 = Content 2.1
}}
|belowstyle =
|below = Below text
}}
<pre style="overflow:auto">
{{sidebar
| title = Top level title
| heading1 = First subsection {{sidebar
| child = yes
| heading1 = Heading 1.1
| content1 = Content 1.1
}}
| heading2 = Second subsection {{sidebar
| child = yes
| heading1 = Heading 2.1
| content1 = Content 2.1
}}
|belowstyle =
|below = Below text
}}
</pre>
Note that omitting the {{para|title}} parameter, and not including any text preceding the embedded sidebar, may result in spurious blank table rows, creating gaps in the visual presentation.

== Full blank syntax ==
(omitting sections 4 to penultimate)

<pre style="overflow:auto;">
{{Sidebar
| name = {{subst:PAGENAME}}
| class = <!--or bodyclass-->
| style = <!--or bodystyle-->
| width =
| cellspacing =
| cellpadding =

| 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 =

<!--...up to 35th:-->

| heading35style =
| heading35 =
| content35style =
| content35 =

| belowclass =
| belowstyle =
| below =

| navbarstyle = <!--or tnavbarstyle-->
| navbarfontstyle = <!--or tnavbarfontstyle-->
| navbar = <!--or tnavbar-->

| wraplinks = <!--true or false-->

}}
</pre>

== Supplementary documentation ==
Supplementary documentation relevant to navigational functionality through 'navbar' coding in a sidebar is at [[Template:Navbar/doc]].

== See also ==
* {{tl|Sidebar with collapsible lists}}
* {{tl|Infobox}}
* [[Wikipedia:UBLIST]], for help in using unbulleted lists in fields.

<includeonly>{{#ifeq:{{PAGENAME}}|{{BASEPAGENAME}}|
[[Category:Sidebar templates| ]]
[[Category:Exclude in print]]
[[Category:Wikipedia metatemplates]]
[[Category:Navigational boxes]]
}}</includeonly>

Navigation menu