Template:Campaignbox/doc: Difference between revisions

Jump to navigation Jump to search
imported>Kirill Lokshin
(→‎Campaignboxes: Convert to doc form)
imported>SWinxy
m (add redirect)
 
(64 intermediate revisions by 41 users not shown)
Line 1: Line 1:
{{#ifeq:{{{noheader|}}}|yes||{{Template doc page}}
{{#ifeq:{{{noheader|}}}|yes |
==Usage==
| {{Documentation subpage}}
{{Template display|nomobile}}
{{Template redirect|Campaign}}
{{Navbox visibility}}
== Usage ==
}}
}}
==== Campaignboxes ====
{{#switch:{{ARTICLESPACE}}
One common type of navigational template is the campaignbox template, which provides quick navigation among the battles in a [[military campaign|campaign]], [[theater (warfare)|theatre]], or war (or, more rarely, among several campaigns or wars).
| Wikipedia =


<div style="float: right; width: 320px; margin-bottom: 1em;">{{Campaignbox Second Punic War}}
====Campaignboxes====
{{Campaignbox Punic Wars}}</div>
| #default =
The campaignbox should generally be included directly after the infobox template, if one is present:


<div style="width:250px;background:#dddddd;border: 1px solid black;padding:0.5em 1em 0.5em 1em"><pre>
===Campaignboxes===
{{Infobox Military Conflict
}}
One common type of navigational template in articles concerning conflicts, wars and related topics is the '''campaignbox''' template, intended to provide context and convenient navigation among articles on the [[battles]] in a [[Military campaign|campaign]], [[Front (military)|front]], [[Theater (warfare)|theater]] or [[war]] (or, more rarely, among several campaigns or wars).
<div style="float:right;width:26.7em;margin-bottom:1.0em;">
{{Campaignbox Second Punic War}}
{{Campaignbox Punic Wars}}
</div>
 
If the article includes an [[Help:Infobox|infobox]], the campaignbox/es are usually placed immediately after it (i.e. just below it). If available, as with infoboxes such as {{tl|Infobox military conflict}}, use the infobox's {{para|campaignbox}} parameter:
<div style="width:25.0em;border:1px solid black;background:#ddd;padding:0.5em 1.0em;">
<pre>
{{Infobox military conflict
...
...
}}
}}
{{Campaignbox XXXX}}
{{Campaignbox XXXX}}
</pre>or<pre>
{{Infobox military conflict
...
| campaignbox = {{campaignbox XXXX}}
}}
</pre></div>
</pre></div>


For particular combinations of the relative sizes of the infobox and the lead section, the presence of a campaignbox may cause [[Wikipedia:How to fix bunched up edit links|bunched up edit links]].
Articles may include multiple campaignboxes; typically, these are stacked under the infobox. The most common scenario occurs when two levels of campaignboxes are present&nbsp;for example, an article about a battle can include both a campaignbox listing the battle itself and an "enclosing" campaignbox listing the campaign, theater or war during which the battle took place.  Similarly, an article about a war can include both a campaignbox listing the war (among a series of wars) and a campaignbox for the war itself, listing the battles that took place during it.
 
Articles may include multiple campaignboxes (which are typically stacked following the infobox). The most common scenario occurs when two levels of campaignboxes are present; for example, an article about a battle can include both a campaignbox listing the battle itself and an "enclosing" campaignbox listing the campaign, theater, or war during which the battle took place.  Similarly, an article about a war can include both a campaignbox listing the war (among a series of wars) and a campaignbox for the war itself, listing the battles that took place during it.


; Creating campaignboxes
=== Creating campaignboxes ===
A campaignbox template should be named ''Template:Campaignbox XXXX'', where XXXX is the name of the campaign (or a shortened form of it), and should use '''{{tl|campaign}}''', as shown below:


<div style="width:200px;background:#dddddd;border: 1px solid black;padding:0.5em 1em 0.5em 1em"><pre>
Existing campaignboxes may be viewed through the [[:Category:Campaignbox templates|Campaignbox template category]] to which campaignboxes are added automatically.  If a new campaignbox becomes necessary, it should be named ''Template:Campaignbox XXXX'' (where XXXX is the (shortened) name of the campaign) and should use {{tlf|Campaignbox}} thus:
{{campaign
<div style="width:16.7em;border:1px solid black;background:#ddd;padding:0.5em 1.0em;">
| name     =
<pre>
| raw_name =
{{Campaignbox
| battles =
| name =  
| title =  
| battles =
| notes =  
}}
}}
</pre></div>
</pre>
 
</div>
* '''name''' – the name of the campaign or war, which should be linked to an article about the campaign if one exists.  Dates should not be indicated unless needed for clarity.  Note that long links may cause alignment problems; see [[WP:MILHIST#NAVPROBLEMS|the troubleshooting guide]] for a workaround.
* '''raw_name''' – the actual name of the created template (i.e. "Campaignbox XXX"); this can be easily produced by using <code><nowiki>{{subst:PAGENAME}}</nowiki></code>.
* '''battles''' – a ''chronological,'' en-dash separated list of battles and operations in the campaign, linked as <code><nowiki>[[Battle of YYYY|YYYY]]</nowiki></code>; non-breaking spaces (<code>&amp;nbsp;</code>) should be used to ensure that multi-word names do not split over multiple lines.
 
For example:
<div style="width: 500px; background: #dddddd; border: 1px solid black; padding: 0.5em 1em 0.5em 1em;"><pre>
{{campaign
| name    = [[Italian War of 1542-46]]
| raw_name = Campaignbox Italian War of 1542–1546
| battles  = [[Siege of Nice|Nice]] –
[[Battle of Ceresole|Ceresole]] –
[[Battle of Serravalle|Serravalle]] –
[[Siege of St. Dizier (1544)|St. Dizier]] –
[[Siege of Boulogne|Boulogne]] –
[[Battle of the Solent|Solent]]
}}
</pre></div>


The use of special formatting (such as bolding or changes in font size) in the list of battles—particularly to mark battles as "important"—is generally discouraged; while there are a ''few'' cases where such approaches may be both helpful to the reader and sufficiently well-sourced that they do not constitute original research, they are both unnecessary and confusing in most circumstances.
==== Parameters ====
; ''name''    : The name by which Wikipedia refers to the template, i.e. "Template:Campaignbox XXXX". This can be produced by using <code><nowiki>{{subst:PAGENAME}}</nowiki></code>.
; ''title''  : The name of the campaign or war, which, if an article about the campaign or war exists, should link to it. Dates should not be indicated unless needed for clarity.  Note that long links may cause alignment problems; see [[WP:MILMOS#NAVPROBLEMS|the troubleshooting guide]] for more information.
; ''battles'' : A chronological list of battles and operations in the campaign, linked as <code><nowiki>[[Battle of YYYY|YYYY]]</nowiki></code>. A convenient and accessible way to separate the items in the list is to add <code>| listclass = hlist</code> and then use the standard <kbd>*</kbd> (asterisk)-based [[Help:List|listing format]].
; ''notes''   : (optional) Any explanatory notes needed to clarify the list. This option should be used sparingly.
; (''raw_name'') : (optional; deprecated) This parameter overrides the use of the title in determining the template name and exists for the sake of backward compatibility. When creating a new campaignbox, both title and name should be specified as above and this parameter omitted.


Dividing the list of battles into multiple blocks by inserting heading-like separations is not recommended in the average case; if such a division is needed, it is typically best accomplished by splitting the template into multiple campaignboxes.
The following optional parameters are passed on to the templates {{tl|Military navigation}} or {{tl|Navbox}} used to create campaignboxes and so can affect their styling. See these two templates' documentation pages for further details.
; ''state'' : To set whether the campaignbox appears fully visible or collapsed (to titlebar only) when it is first presented by a page.
; ''bodyclass'' : CSS styling to affect the whole template.
; ''listclass'' : CSS styling to affect the list of battles, operations, etc. (e.g. to affect {{para|battles}}).


Articles other than those about military conflicts—such as those dealing with personnel or military units—may use the campaignbox formatting to create lists of battles or wars in which the subject participated.  In this case, the box should be created by including {{tl|campaign}} directly in the article, without creating a separate template.<noinclude>{{TOCright}} <br/>'''Campaignboxes are generally listed here in chronological order by the START of the conflict''', with some subdivision by theater in the case of extremely complicated conflicts.
The use of special formatting (such as bolding or changes in font size) in the list of battles{{spaced ndash}}particularly to mark battles as "important"{{spaced ndash}}is generally discouraged; while there are a ''few'' cases where such approaches may be both helpful to the reader and sufficiently well-sourced that they do not constitute original research, they are usually both unnecessary and potentially confusing.  Similarly, dividing the list of battles into multiple blocks by inserting heading-like separations should be exceptional; if such a division is felt to be needed, a better solution may be to split the one campaignbox into two or more.<noinclude>


Existing campaignboxes may be browsed through [[:Category:Campaignboxes]], which is automatically generated from the meta-template transclusion.<noinclude>[[Category:WikiProject Military history template instructions|Campaignbox]]</noinclude><includeonly>{{#ifeq:{{{noheader|}}}|yes||
[[Category:WikiProject Military history template instructions|Campaignbox]]
</noinclude><includeonly>{{Sandbox other||
[[Category:Campaignbox templates| ]]
{{#ifeq:{{{noheader|}}}|yes | |
[[Category:Navigational box wrapper templates]]
[[Category:Military navigational boxes|Campaignbox]]
[[Category:Military navigational boxes|Campaignbox]]
[[Category:Templates using ParserFunctions|{{PAGENAME}}]]
[[Category:Templates that add a category]]
}}</includeonly>
}}}}</includeonly>

Latest revision as of 18:50, 3 August 2022

Template:Template display Template:Template redirect Template:Navbox visibility

Usage

Campaignboxes

One common type of navigational template in articles concerning conflicts, wars and related topics is the campaignbox template, intended to provide context and convenient navigation among articles on the battles in a campaign, front, theater or war (or, more rarely, among several campaigns or wars).

If the article includes an infobox, the campaignbox/es are usually placed immediately after it (i.e. just below it). If available, as with infoboxes such as {{Infobox military conflict}}, use the infobox's |campaignbox= parameter:

{{Infobox military conflict
...
}}
{{Campaignbox XXXX}}
or

{{Infobox military conflict ... | campaignbox = {{campaignbox XXXX}} }}

Articles may include multiple campaignboxes; typically, these are stacked under the infobox. The most common scenario occurs when two levels of campaignboxes are present – for example, an article about a battle can include both a campaignbox listing the battle itself and an "enclosing" campaignbox listing the campaign, theater or war during which the battle took place. Similarly, an article about a war can include both a campaignbox listing the war (among a series of wars) and a campaignbox for the war itself, listing the battles that took place during it.

Creating campaignboxes

Existing campaignboxes may be viewed through the Campaignbox template category to which campaignboxes are added automatically. If a new campaignbox becomes necessary, it should be named Template:Campaignbox XXXX (where XXXX is the (shortened) name of the campaign) and should use {{Campaignbox}} thus:

{{Campaignbox
| name = 
| title = 
| battles = 
| notes = 
}}

Parameters

name
The name by which Wikipedia refers to the template, i.e. "Template:Campaignbox XXXX". This can be produced by using {{subst:PAGENAME}}.
title
The name of the campaign or war, which, if an article about the campaign or war exists, should link to it. Dates should not be indicated unless needed for clarity. Note that long links may cause alignment problems; see the troubleshooting guide for more information.
battles
A chronological list of battles and operations in the campaign, linked as [[Battle of YYYY|YYYY]]. A convenient and accessible way to separate the items in the list is to add | listclass = hlist and then use the standard * (asterisk)-based listing format.
notes
(optional) Any explanatory notes needed to clarify the list. This option should be used sparingly.
(raw_name)
(optional; deprecated) This parameter overrides the use of the title in determining the template name and exists for the sake of backward compatibility. When creating a new campaignbox, both title and name should be specified as above and this parameter omitted.

The following optional parameters are passed on to the templates {{Military navigation}} or {{Navbox}} used to create campaignboxes and so can affect their styling. See these two templates' documentation pages for further details.

state
To set whether the campaignbox appears fully visible or collapsed (to titlebar only) when it is first presented by a page.
bodyclass
CSS styling to affect the whole template.
listclass
CSS styling to affect the list of battles, operations, etc. (e.g. to affect |battles=).

The use of special formatting (such as bolding or changes in font size) in the list of battles – particularly to mark battles as "important" – is generally discouraged; while there are a few cases where such approaches may be both helpful to the reader and sufficiently well-sourced that they do not constitute original research, they are usually both unnecessary and potentially confusing. Similarly, dividing the list of battles into multiple blocks by inserting heading-like separations should be exceptional; if such a division is felt to be needed, a better solution may be to split the one campaignbox into two or more.