Vorlage:Sidebar/doc: Unterschied zwischen den Versionen

Aus C3D2
Zur Navigation springen Zur Suche springen
*>Zackmann08
(→‎Supplementary documentation: adding tracking category)
 
K (1 Version importiert)
 
(kein Unterschied)

Aktuelle Version vom 26. November 2017, 14:07 Uhr

Vorlage:Documentation subpage

Interner Lua-Fehler: Der Interpreter beendet sich mit dem Status 127. Vorlage:About

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.

Vorlage:Tl is a version of Vorlage:Tl that adds collapsibility to its sections, i.e. the means to show or hide sections by clicking links beside their headings.

Navboxes and other templates using the navbox or vertical-navbox attributes are not displayed on the Mobile Web site for Wikipedia, which accounts for approximately 45% of readers.

Usage

Vorlage:Generic template demo (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 Vorlage:Small Vorlage:Tl links along the bottom of a Vorlage:Tlf 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). (This does not apply if the Lua module that produces Vorlage:Tlf, Module:Sidebar, is being used directly.)

Principal parameters

Parameter Explanation
Vorlage:Para 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 Vorlage:Small Vorlage:Tl links at the bottom of the sidebar are to function correctly, unless their appearance is suppressed (see the navbar parameter below) or Vorlage:Tlf is not being used as a wrapper for Module:Sidebar. When Vorlage:Tlf is used as a wrapper, setting Vorlage:Para is recommended.
Vorlage:Para Use to place a title for the sidebar immediately above the sidebar.
Vorlage:Para Use to place an image at the top of the sidebar, i.e. above Vorlage:Para (if used). Full wiki syntax is expected (i.e. [[File:...]]).
To add a caption below the image, use Vorlage:Para.
Vorlage:Para Use to place a line such as "Part of the X series on" before the title.
Vorlage:Para Use to place a title for the sidebar at the top of the sidebar. (If Vorlage:Para is used, it will appear immediately below it).
Vorlage:Para Use to place an image between the Vorlage:Para (if used) and first section. As with Vorlage:Para, full wiki syntax is expected (i.e. [[File:...]]).
To add a caption below the image, use Vorlage:Para.
Vorlage:Para Use to alter the default CSS styling set for section headings.
To alter the CSS styling for a specific section's heading, use Vorlage:Para, where n is the number of the section.
Vorlage:Para Use to alter the default CSS styling set for section content.
To alter the CSS styling for a particular section's content, use Vorlage:Para, where n is the number of the section.
Vorlage:Para
Vorlage:Para
First section's headingVorlage:\content. content1 is required if heading1 is also to appear.
Vorlage:Para
Vorlage:Para
Second section's headingVorlage:\content. (content2 required if heading2 also to appear; etc.)
Vorlage:Para
Vorlage:Para
Third section's headingVorlage:\content.
...... etc ......
Vorlage:Para
Vorlage:Para
Currently, the last possible section heading and/or content.

Other parameters

Parameter Explanation
Vorlage:Para Same as the Vorlage:Para offered by Vorlage:Tl.

Microformat classes for the corresponding parameters.
(Vorlage:Para and Vorlage:Para are applied across the whole sidebar.)

Vorlage:Para Same as the Vorlage:Para offered by Vorlage:Tl.
(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.
(Vorlage:Para and Vorlage:Para are applied across the whole sidebar.)

Vorlage:Para
Vorlage:Para
Use to amend the default cellspacingVorlage:\cellpadding set for the infobox-class table with which the sidebar is built.
Vorlage:Longitem Set to "off", "none", etc. (without quotes) to remove the Vorlage:Tl links (Vorlage:Small) that otherwise appear at the bottom of the sidebar.
Vorlage:Longitem Use to specify the font style used by the navbar at the bottom of the sidebar (see Vorlage:Tl for options available).

Handling long links

Vorlage:Tl 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 Vorlage:Tlx, where Vorlage:Para is the long link without its square brackets.

Use the Vorlage:Para parameter to turn link wrapping off for the whole template.

Embedding

One sidebar template can be embedded into another using the Vorlage:Para parameter. This feature can be used to create a modular sidebar, or to create more well-defined and logical sections.

Interner Lua-Fehler: Der Interpreter beendet sich mit dem Status 127.

{{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
 }}
| below = "below" text
}}

Note in the examples above that the child sidebar is placed in a Vorlage:Code field, not a Vorlage:Code field. Notice also that the section subheadings do not appear in bold if this is not explicitly specified. To obtain bold section headings, place the child sidebar in a Vorlage:Code field, using either:

Interner Lua-Fehler: Der Interpreter beendet sich mit dem Status 127.

{{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
 }}
| below = "below" text
}}

or:

Interner Lua-Fehler: Der Interpreter beendet sich mit dem Status 127.

{{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
 }}
| below = "below" text
}}

Note that omitting the Vorlage:Para parameter and not including any text preceding the embedded sidebar may result in the creation of gaps by spurious blank rows.

Full blank syntax

Vorlage:Generic template demo

(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 Vorlage:Tl use within a sidebar) is at Template:Navbar/doc.

Tracking Categories

See also