Template:Campaignbox/doc: Difference between revisions

Jump to navigation Jump to search
imported>CWenger
m (−hyphen)
imported>Portuguese Man o' War
(update to recommend usage of the same parameter names as template:navbox and usage of template:flatlist, as navbox does at: Template:Navbox#Examples)
Line 2: Line 2:
==Usage==
==Usage==
}}
}}
==== Campaignboxes ====  
===Campaignboxes===  
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).
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).


<div style="float: right; width: 320px; margin-bottom: 1em;">{{Campaignbox Second Punic War}}
<div style="float: right; width: 320px; margin-bottom: 1em;">{{Campaignbox Second Punic War}}
Line 9: Line 9:
The campaignbox should generally be included directly after the infobox template, if one is present:
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>
<div style="width:250px; background: #ddd; border: 1px solid black; padding:0.5em 1em 0.5em 1em;"><pre>
{{infobox military conflict
{{infobox military conflict
...
...
Line 21: Line 21:
Existing campaignboxes may be viewed through the [[:Category:Campaignbox templates|automatically generated category]].  If a new one is necessary, it 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:
Existing campaignboxes may be viewed through the [[:Category:Campaignbox templates|automatically generated category]].  If a new one is necessary, it 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>
<div style="width: 200px; background: #ddd; border: 1px solid black; padding:0.5em 1em 0.5em 1em;"><pre>
{{campaign
{{campaign
|raw_name =  
| name    =  
|name    =  
| title  =  
|battles =  
| battles =  
|notes   =  
| 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:MILMOS#NAVPROBLEMS|the troubleshooting guide]] for a workaround.
; 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>. <small>deprecated: older usage is '''raw_name'''.</small>
* '''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>.
; title: 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:MILMOS#NAVPROBLEMS|the troubleshooting guide]] for a workaround. <small>deprecated: older usage is '''name''', which assumes '''raw_name''', above.</small>
* '''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.
; battles: a ''chronological'' list of battles and operations in the campaign, linked as <code><nowiki>[[Battle of YYYY|YYYY]]</nowiki></code>. {{tl|Flatlist}} provides an accessible and semantically valid method (using an HTML list) of separating items. <small>(Older usage is an en-dash separated list using non-breaking spaces (<code>&amp;nbsp;</code>) to ensure that multi-word names do not split over multiple lines.</small> In most case, non-breaking spaces and related templates ({{tl|nowrap}} et al) are no longer appropriate, as links in such navigation boxes now inherit <code>white-space: nowrap;</code> from their containing box.
* '''notes''' – ''optional'' – any needed explanatory notes for the list of operations; this field should be used sparingly.
; notes: ''optional''&nbsp;– any needed explanatory notes for the list of operations; this field should be used sparingly.


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.  Similarly, 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.<noinclude>[[Category:WikiProject Military history template instructions|Campaignbox]]</noinclude><includeonly>{{#ifeq:{{{noheader|}}}|yes||
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.  Similarly, 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.<noinclude>[[Category:WikiProject Military history template instructions|Campaignbox]]</noinclude><includeonly>{{#ifeq:{{{noheader|}}}|yes||

Revision as of 01:42, 15 September 2011

Usage

Campaignboxes

One common type of navigational template is the campaignbox template, which provides quick navigation among the battles in a campaign, theatre, or war (or, more rarely, among several campaigns or wars).

The campaignbox should generally be included directly after the infobox template, if one is present:

{{infobox military conflict
...
}}
{{campaignbox XXXX}}

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

Existing campaignboxes may be viewed through the automatically generated category. If a new one is necessary, it should be named Template:Campaignbox XXXX, where XXXX is the name of the campaign (or a shortened form of it), and should use {{campaign}}, as shown below:

{{campaign
| name    = 
| title   = 
| battles = 
| notes   = 
}}
name
the actual name of the created template (i.e. "Campaignbox XXX"); this can be easily produced by using {{subst:PAGENAME}}. deprecated: older usage is raw_name.
title
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 the troubleshooting guide for a workaround. deprecated: older usage is name, which assumes raw_name, above.
battles
a chronological list of battles and operations in the campaign, linked as [[Battle of YYYY|YYYY]]. {{Flatlist}} provides an accessible and semantically valid method (using an HTML list) of separating items. (Older usage is an en-dash separated list using non-breaking spaces (&nbsp;) to ensure that multi-word names do not split over multiple lines. In most case, non-breaking spaces and related templates ({{nowrap}} et al) are no longer appropriate, as links in such navigation boxes now inherit white-space: nowrap; from their containing box.
notes
optional – any needed explanatory notes for the list of operations; this field should be used sparingly.

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. Similarly, 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.