Template:Collapsible archive box

From Sarkarverse
Jump to navigation Jump to search
{{{3}}}
Template:Collapsible archive box/editlink
{{{2}}}
Documentation icon Template documentation
This is the documentation for the Template:Collapsible archive box.
All text reading Template:Name_here should be Template:Collapsible archive box.

This template, Template:Collapsible archive box, allows you to display archived talk pages on a Wikipedia page[Note 1] like what the {{Template:Archive box}} does, but with this template the archive box is collapsible meaning it can be hidden and shown. This template is ideal for talk pages with a lot of headers and/or archives, and to keeping scrolling of the page to a minimum for the viewer.

Usage [1]

You can use the archive box by customizing and then adding the code below to any page[Note 2].

{{Template:Collapsible archive box|Type|
Content
|Header|Width}}

Parameters [1.A]

The syntax consists of four parameters labeled Type ['''Type''' use 1], Content ['''Content''' use 1], Header ['''Header''' use 1], and Width ['''Width''' use 1].

Required parameters [1.A.1]

The parameters Type, Content, and Header are always needed for this template[Note 3].

Optional parameters [1.A.2]

The Width parameter is optional.[Note 4][Note 5][Note 6].


  1. ^ More information on Type below.

Type Parameter [1.B]

Substitute the Type parameter with collapsed for an archive box that starts hidden or delete the entire parameter[Note 7] for an archive box that starts shown.

Hidden by default archive box example [1.B.1]

This is an example where the archive box starts hidden.

{{Template:Collapsible archive box|collapsed|
*[[Talk:Example/Archive_01|Archive 01]]: March 9, 2008 - April 11th, 2009
|Hidden Archive Example}}

Template:Collapsible archive box/example Will produce the archive box to the right labeled: Hidden Archive Example →

Expanded by default archive box example [1.B.2]

This is an example where the archive box starts shown.

{{Template:Collapsible archive box||
*[[Talk:Example/Archive_01|Archive 01]]: March 9, 2008 - April 11th, 2009
|Expanded Archive Example}}

Template:Collapsible archive box/example Will produce the archive box to the right labeled: Expanded Archive Example →







  1. ^ More information on Content below.

Content Parameter [1.C]

Substitute Content with the link(s) to the archived talk pages. It is recommended you begin each line with a bullet using the * symbol[Note 8]. You may also use HTML or Wiki markup although it is not required. If you decide to use markup make sure whatever you use works[Note 9], because some markup will break the code and anything that comes after the tags will not be displayed.[Note 10]

Single line example [1.C.1]

This is an example where a single link to an archived page is provided alongside text.

{{Template:Collapsible archive box|collapsed|
*[[Talk:Example/Archive_01|Archive 01]]: March 9, 2008 - April 11th, 2009
|One Item Example}}

Template:Collapsible archive box/example Will produce the archive box to the right labeled: One Item Example →

Multiple lines example [1.C.2]

This is an example where multiple links to archived pages, lines 1 and 3 have text and line 2 has only a link.

{{Template:Collapsible archive box|collapsed|
*[[Talk:Example/Archive_01|Archive 01]]: March 2, 2005 - May 5, 2006
*[[Talk:Example/Archive_02|Archive 02]]
*[[Talk:Example/Archive_02|Archive 01]]: March 10, 2008 - April 12, 2009
|Multiple Items Example}}

Template:Collapsible archive box/example Will produce the archive box to the right labeled: Multiple Items Example →

Multiple lines with markup example [1.C.3]

This is an example where multiple links to archived pages are provided along with text. Additionally both the text and links have HTML and Wiki markups.

{{Template:Collapsible archive box|collapsed|
*[[Talk:Example/Archive_01|'''Archive 01''']]: &nbsp;&nbsp;&nbsp;<s>March 2, 2005 - May 5, 2006</s>
*[[Talk:Example/Archive_02|''Archive 02'']]: <!-- Comment -->May <sub>6</sub>, 2006 - March <sup>9</sup>, 2008
*[[Talk:Example/Archive_02|<u>Archive 01</u>]]:<br>March 10, 2008 - April 12, 2009
|Content w/ Markup Example}}

Template:Collapsible archive box/example Will produce the archive box to the right labeled: Content w/ Markup Example →

No Bullets Example [1.C.4]

This is an example where no bullets are used.

{{Template:Collapsible archive box|collapsed|
Line 1<br>
Line 2<br>
[[Talk:Example/Archive_01|Archive 01]]: March 9, 2008 - April 11th, 2009
|No Bullets Example}}

Template:Collapsible archive box/example Will produce the archive box to the right labeled: No Bullets Example →


  1. ^ More information on Header below.

Header Parameter [1.D]

Substitute Header with text to display on top of the archive box. A simple message or word is recommended, for example Archive Box would work. As with the Archive Links parameter you can use wiki or HTML markup but some tags will not work.[Note 9][Note 10]

Simple header example [1.D.1]

This is an example where the header text is just a simple string with no HTML or Wiki markups.

{{Template:Collapsible archive box|collapsed|
|Simple Header Example}}

Template:Collapsible archive box/example Will produce the archive box to the right labeled: Simple Header Example →

Header with markup example [1.D.2]

This is an example where the header text has multiple HTML and Wiki markups.

{{Template:Collapsible archive box|collapsed|
*Example 1
*Example 2
|<small><sup>A</sup>r<s>c</s>h<sub>i</sub>ve '''Ex'''''am''<u>ple</u></small>}}

Template:Collapsible archive box/example Will produce the archive box to the right labeled: Archive Example


  1. ^ More information on Width below.

Width Parameter [1.E]

Substitute the Width parameter with a number[Note 11] for the desired width of the archive box. The Width parameter is optional[Note 6][Note 4]. Try and keep the number for the Width parameter reasonable like 250, so not too large and not too small[Note 12]

Small width example [1.E.1]

This is an example where a small width is given.

{{Template:Collapsible archive box|collapsed|
*Example 1
*Example 2
|Small Width Example|75}}

Template:Collapsible archive box/example Will produce the archive box to the right labeled: Small Width Example →

Large width example [1.E.2]

This is an example where a large width is given.

{{Template:Collapsible archive box|collapsed|
*Example 1
*Example 2
|Large Width Example|500}}

Template:Collapsible archive box/example Will produce the archive box to the right labeled: Large Width Example →

No width given example [1.E.3]

This is an example where no width is given[Note 4].

{{Template:Collapsible archive box|collapsed|
*Example 1
*Example 2
|Default Width Example}}

Template:Collapsible archive box/example Will produce the archive box to the right labeled: Default Width Example →

Proper placement [2]

You should place the template code above all the messages on the talk page and under the headers and/or templates already on the talk page[Note 13]. The Collapsible archive box will always be on the right margin of the page. Make sure the archive box looks right on the page and does not mess up existing text[Note 10].

Additional examples [3]

Below are additional examples.

Random example 1 [3.A]

{{Template:Collapsible archive box|collapsed|
*Example 1
*Example 2
|Ex 1|500}}

Template:Collapsible archive box/example Will produce the archive box to the right labeled: Random Example 1 →

Random Example 2 [3.B]

{{Template:Collapsible archive box||
*<small>'''''Example 1'''''</small>
|Ex 2|500}}

Template:Collapsible archive box/example



Will produce the archive box to the right labeled: Random Example 2 →

Text alignment example 3 [3.C]

{{Template:Collapsible archive box|collapsed|
'''''Example 1'''''
{{center|'''''Example 2'''''}}
{{right|'''''Example 3'''''}}
|Ex 2|500}}

Template:Collapsible archive box/example Will produce the archive box to the right labeled: Text Alignment Example →

Miscellaneous [4]

Anything that does not have to do with the template usage.

Related templates [4.A]

Similar templates to this one include:

Discussion and help [4.B]

If you need help with this template or simply wish to discuss the template or the template documentation, please go to the discussion page and leave a message and sign with your signature using ~~~~.

Template usage [5]

Footnotes [6]

  1. ^ Typically the page will be an article or user talk page.
  2. ^ Not the exact code because you need to first edit the parameters.
  3. ^ If any of these three parameters are not used then the template will be broken.
  4. ^ a b c If a number is not provided for Width the template will default to 230px.
  5. ^ If you do not use the Width parameter remove the Width text and the | that is in front of the Widthtext.
  6. ^ a b
    {{Template:Collapsible archive box|Type|
    Content
    |Header|Width}}
    

    The syntax above is what the template code should look like if you choose not to use the Width parameter.

  7. ^ Delete the entire parameter text: |Type
  8. ^ If you do not use a * before each line you will probably have to use <br> after each line for every line except for the last one. Additionally the * cannot be formatted for example <i>*</i> will not produce a bullet.
  9. ^ a b <font></font> tags will not work with this template. For example, <font color="red"></font> will simply break the template without providing any font colour to the text.
  10. ^ a b c To make sure the page looks right after placing the archive box you should, as with all edits, use the 'Show Preview button when editing a page to see what the page will look like when you save the page and correct any mistakes as needed.
  11. ^ The number used for Width is the number of px (pixels) wide you wish the archive box to be.
  12. ^ For example, 5 would be too small and 4000 would be to big.
  13. ^ There may be exceptions, for example if when placed that way the page does not look right or if you are placing the archive box on a page that is not a talk page.

Template:Collapsible archive box/footnote

See also