Changes

Jump to navigation Jump to search
m
Since <tt> is obsolete in HTML5, replace it with <kbd> – see HTML element#tt, Wikipedia:HTML5, and mw:Help:Extension:Linter/obsolete-tag. using AWB
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AT THE BOTTOM OF THIS PAGE AND INTERWIKIS TO WIKIDATA -->

{{notice|This template is a legacy wrapper for {{tl|archives}}, which may have additional functionality over-and-above this template and generates the list of archives automatically by default.}}

This template can be used to display archives of a page in a floating box.

===Usage===
Include the archive box on the talk page by adding:

====Basic syntax====
<pre>{{Archive box | [[Archive <#>]] }}</pre>

====Full syntax====
<pre>
{{Archive box
| archivelist = /archivelist
| auto = <short|long|yes|no>
| index = /Archive index
| links = <#>
| search = <yes|no>
| collapsible = <yes|no>
| collapsed = <yes|no>
| box-width = <#px or #em>
| root = Wikipedia_talk:{{PAGENAME}}
| style = <CSS values>
| title = <Alt. title>
| image = [[File:Foo.png|35px]]
| bot = <name of bot>
| units = <time units (defaults to days)>
| age = <#> (defaults to days) |
[[/Archive <#>]], [[/Archive <#>]], [[/Archive <#>]], etc.
}}
</pre>

Substitute <code>[[/Archive <#>]]</code> with the actual name(s) of the archive page(s). In the above replace each value enclosed inside <nowiki><</nowiki> and <nowiki>></nowiki> with an actual value or leave it empty. Replace the File:Foo.png with an actual image or remove that field entirely. Remember to remove the explanation "(defaults to days)". How you present a list of archive pages is up to you. You can separate them with commas or format them as lists. You can also use [[Wikipedia:Piped link|piped links]], see the [[#Automatic links]] and [[#Examples]] sections below.

===Parameters===
==== Placement ====
The box uses a style that makes it float to the right. In other words, it will be aligned to the right edge of the page and all content following it will flow around the box. (On some article and WikiProject talk pages, there is more than one right floating box. In that case, the edit links of the text sections next to those boxes often "bunch up". Use the {{tl|stack}} template to provide a solution for that problem.)

====Box width====
The box width can be set by using the <code>|box-width=</code> parameter:
<pre>{{Archive box | box-width=13em | [[/Archive <#>]] }}</pre>
<pre>{{Archive box | box-width=200px | [[/Archive <#>]] }}</pre>

The standard width when this parameter is not used is 238px.

====Search====
A search bar which will search the archives of the current page can be added to the bottom of the box by using the <kbd><nowiki>|search=yes</nowiki></kbd> parameter. Other parameters can adjust the search bar.
*<kbd><nowiki>|root=</nowiki></kbd> can be used to change the prefix of pages which are searched. The default is the current page name. ''Example: ''<kbd><nowiki>|root=User talk:Example/Archives</nowiki></kbd>'' will search in pages starting with User talk:Example/Archives/.''
*<kbd><nowiki>|search-width=</nowiki></kbd> can be used to change the width of the text field, in characters. The default is 22, which fits the search bar with the default box width. ''Note: unlike ''<kbd><nowiki>|box-width=</nowiki></kbd>'', this is a bare number with no units.''
*<kbd><nowiki>|search-break=yes</nowiki></kbd> will insert a break between the search bar and search button. The default is ''no''.
*<kbd><nowiki>|button-label=</nowiki></kbd> can be used to change the text on the search button. The default is ''Search''.
<pre>{{Archive box | search=yes | [[/Archive <#>]] }}</pre>

====Image====
The image can be changed from the default using the {{para|image}} parameter. For example:
<pre>{{Archive box | image= [[Image:Crystal Clear app file-manager.png|35px]] | [[/Archive <#>]] }}</pre>

=====Other icons=====
If you wish to use something other than the default icon, there's a gallery of available icons at [[commons:Category:Archive icons]].

====Style====
<pre>
{{Archive box | style= <var>CSS values</var> | [[/Archive <#>]] }}
</pre>
Examples:
;Talk page colors on non-talk pages:<code>background-color:#F8EABA; border-color:#C0C090;</code>
;Other page colors on talk pages:<code>background-color:#F9F9F9; border-color:#AAAAAA;</code>
;Font size unchanged:<code>font-size:1em;</code>
;Specific example, changing the background color to white : <kbd><nowiki>{{archive box | auto=yes | style=background-color:#FFFFFF }}</nowiki></kbd>

====Automatic links====
If all the archives of a talk page are named ''exactly'' <kbd>/Archive 1</kbd>, <kbd>/Archive 2</kbd> etc. (it will ''not'' work with e.g. <kbd>/Archive1</kbd>, <kbd>/Archive 01</kbd>, or subpages of a subpage, e.g. <kbd>/Archives/Archive 1</kbd>), you can use the <kbd>auto</kbd> parameter to display links to them all automatically. The list will update itself when new archives are added. If there are also named archives, you can manually add links to those as well.

;Using <code>|auto=yes</code>:
The links to the archive pages will appear as simple numbers, separated with commas (1, 2, 3, ...). '''Note:''' Archives numbered past 100 will be ignored.
<pre>{{archive box | auto=yes }}</pre>

The optional ''root='', ''links='', and ''nobr='' parameters are passed to {{tl|archive list}} when '''auto=yes'''. The following will look for a user's talk-page archives named ''/Archives/Archive 1'', ''/Archives/Archive 2'', etc., and list up to 5 archives per line:
<pre>
{{archive box
|auto= yes
|root= User_Talk:{{PAGENAME}}/Archives
|links= 5
}}</pre>

;Using <code>|auto=long</code>:
If there are no more than 36 archive pages, and you prefer a three-column output, use <code>|auto=long</code>. The links to the archive pages will appear as Archive 1, Archive 2, etc. The links will be put into lines with a line break after each third link, to create columns. (Re-arranging the columns, e.g. from top to bottom, is ''not'' possible with this parameter. However, manually added links can be arranged in columns with {{tl|multicol}}. See the [[#multicol|multicol example]] below.)
<pre>{{archive box |auto=long }}</pre>

The optional <code>|root=</code> parameter is passed to {{tl|archive list}} when <code>|auto=long</code>. The following will look for a user's talk-page archives named ''/Archives/Archive 1'', ''/Archives/Archive 2'', etc.
<pre>
{{archive box
|auto= long
|root= User_Talk:{{PAGENAME}}/Archives
}}</pre>

===Examples===
For actual examples of the use of this template, use the [[Special:Whatlinkshere/Template:Archive box|what links here]] link in the toolbox on the sidebar, near the top on the left side of this page (unless you are using an unconventional skin ... in which case you probably know what you are doing).

{| align="center" style="background: transparent;"
! Wikitext !! Appearance
|-
|<pre>{{archive box|search=yes|
[[/Archive 1]],
[[/Archive 2]],
[[/January 2008 - December 2008]] and
[[/Deletion discussion]]
}}</pre>
|{{archive box|search=yes|
[[/Archive 1]],
[[/Archive 2]],
[[/January 2008 - December 2008]] and
[[/Deletion discussion]]}}
|-
|<pre>{{archive box| {{plainlist|indent=1|
*[[/Archive 1]]
*[[/Archive 2]]
*[[/January 2008 - December 2008]]
*[[/Deletion discussion]]
}}}}</pre>
|{{archive box| {{plainlist|indent=1|
*[[/Archive 1]]
*[[/Archive 2]]
*[[/January 2008 - December 2008]]
*[[/Deletion discussion]]
}}}}
|-
|<pre>{{archive box|
: [[/Archive 1]]
: [[/Archive 2]]
: [[/January 2008 - December 2008]]
: [[/Deletion discussion]]
}}</pre>
|{{archive box|
: [[/Archive 1]]
: [[/Archive 2]]
: [[/January 2008 - December 2008]]
: [[/Deletion discussion]]}}
|-
|<pre>{{archive box|image=[[Image:File-manager.svg|35px]]|
* [[/Archive 1|Archive 1]]
* [[/Archive 2|Archive 2]]
* [[/January 2008 - December 2008|January 2008 - December 2008]]
* [[/Deletion discussion|Deletion discussion]]
}}</pre>
|{{archive box|image=[[Image:File-manager.svg|35px]]|
* [[/Archive 1|Archive 1]]
* [[/Archive 2|Archive 2]]
* [[/January 2008 - December 2008|January 2008 - December 2008]]
* [[/Deletion discussion|Deletion discussion]]}}
|-
|<pre>{{archive box|index=/Archive index|search=yes|bot=FooArchiveBot|age=90|
# [[/Archive 1]]
# [[/Archive 2]]
# [[/January 2008 - December 2008]]
# [[/Deletion discussion]]
}}</pre>
|{{archive box|index=/Archive index|search=yes|bot=FooArchiveBot|age=90|
# [[/Archive 1]]
# [[/Archive 2]]
# [[/January 2008 - December 2008]]
# [[/Deletion discussion]]}}
|-
|<pre>{{archive box|box-width=10em|
* [[/Archive 1|Archive 1]]
* [[/Archive 2|Archive 2]]
* [[/January 2008 - December 2008|January 2008&nbsp;– December 2008]]
}}</pre>
|{{archive box|box-width=10em|
* [[/Archive 1|Archive 1]]
* [[/Archive 2|Archive 2]]
* [[/January 2008 - December 2008|January 2008&nbsp;– December 2008]]}}
|- id="multicol"
|<pre>{{Archive box|
{{flatlist|
;2007
:[[/Archive1|1]]
:[[/Archive2|2]]
:[[/Archive3|3]]
:[[/Archive4|4]]
:[[/Archive5|5]]
}}{{flatlist|
;2008
:[[/Archive6|6]]
:[[/Archive7|7]]
:[[/Archive8|8]]
:[[/Archive9|9]]
:[[/Archive10|10]]
:[[/Archive11|11]]
}}{{flatlist|
;2009
:[[/Archive12|12]]
:[[/Archive13|13]]
}}
}}</pre>
|
{{Archive box|
{{flatlist|
;2007
:[[/Archive1|1]]
:[[/Archive2|2]]
:[[/Archive3|3]]
:[[/Archive4|4]]
:[[/Archive5|5]]
}}{{flatlist|
;2008
:[[/Archive6|6]]
:[[/Archive7|7]]
:[[/Archive8|8]]
:[[/Archive9|9]]
:[[/Archive10|10]]
:[[/Archive11|11]]
}}{{flatlist|
;2009
:[[/Archive12|12]]
:[[/Archive13|13]]
}}
}}
|-
|<pre>{{archive box|search=yes|
{{Center|'''Sorted by date:'''}}
:#[[/Archive1|August&ndash;October 2008]]: Discussion with User.
:#[[/Archive2|August&ndash;November 2008]]: Discussion of rewrite.
:[[/Subpage 1]], [[/Subpage 2|2]], [[/Subpage 3|3]]
}}</pre>
|{{archive box|search=yes|
{{Center|'''Sorted by date:'''}}
:#[[/Archive1|August&ndash;October 2008]]: Discussion with User.
:#[[/Archive2|August&ndash;November 2008]]: Discussion of rewrite.
:[[/Subpage 1]], [[/Subpage 2|2]], [[/Subpage 3|3]]
}}
|}

===Notes===
====Talk header ====
Many talk pages already include the {{tl|Talk header}} template. By default, this template includes links to archive subpages assuming the archive subpages are numbered in the standard manner (Archive 1, Archive 2, etc.). If the {{tl|Talk header}} template ''is'' on a page, and archive subpages ''are'' named in the standard manner, then a separate archive box is likely unnecessary. On the other hand, a separate archive box can pipe links (i.e. to display the date range of the archive). If you decide to go ahead and use the archive box anyway, you can add <code>|noarchive=yes</code> to the Talk header to remove the redundant links to archives.

===See also===
* {{tl|archives}}
* {{tl|archive box collapsible}}
* {{tl|talk archive navigation}}
* [[Help:Archiving a talk page]]
* Tracking: [[:Category:Archive boxes with unusual parameters]]

{{Warchivenav}}

<includeonly>{{sandbox other||
<!-- CATEGORIES GO JUST BELOW AND INTERWIKIS GO TO WIKIDATA, THANK YOU! -->
[[Category:Archival templates]]
[[Category:Talk header templates]]
}}</includeonly>
Anonymous user

Navigation menu