Template:Chapters/doc: Difference between revisions
From MediaWiki
Jump to navigationJump to search New page: '''<tt><nowiki>{{chapters}}</nowiki></tt>''' is used to create a "Chapter Navigation" item. <pre>{{chapters |title=A Title |prev=Previous (optional) |next=Next (optional) |center=true (op... |
Tigerpaw28 (talk | contribs) New documentation format |
||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
'''<tt><nowiki>{{chapters}}</nowiki></tt>''' is used to create a "Chapter Navigation" item. | __NOTOC__ | ||
== Description == | |||
'''<tt><nowiki>{{chapters}}</nowiki></tt>''' is used to create a "Chapter Navigation" item. It is the basis for many of our navigation templates. | |||
== Usage == | |||
===Parameters=== | |||
====Required==== | |||
* ''title'' - A title. | |||
====Optional==== | |||
* ''prev'' - The article name to which the previous nav button should point. | |||
* ''next'' - The article name to which the next nav button should point. | |||
* ''center'' - Centers the entire box unit, default is true. | |||
* ''align'' - Aligns the text within the main box. Options are left, right and center. Default is center. | |||
* ''float'' - Sets the CSS float style. Make sure to set "center=false" if you want to float this! | |||
* ''style'' - Sets the header to one of the three default color schemes shown below. Anything other than 2 or 3 will result in style 1. Style 3 matches episode and comic issue info boxes. | |||
* ''collapsible'' - Set to true if you want the main box to be able to collapse to just the title | |||
* ''headerbgcolor'' - Sets the color of the header to whatever HTML/CSS compatible color specification you want. This will override the background set by ''style''. | |||
* ''headertextcolor'' - Sets the text color of the header. If the title is a link, this will not work and the text will either be white by default or if you set style 3 it will be black. | |||
* ''content'' - What to display under the title bar. | |||
=== Code === | |||
<pre>{{chapters | <pre>{{chapters | ||
|title=A Title | |title=A Title | ||
|prev=Previous | |prev=Previous | ||
|next=Next | |next=Next | ||
|center=true | |center=true | ||
|content=*[[ | |align=left | ||
*[[ | |float=none | ||
*[[ | |style=2 | ||
*[[ | |collapsible=false | ||
|headerbgcolor=red | |||
|headertextcolor=green | |||
|content=*[[Santa Claus]] | |||
*[[Christmas]] | |||
*[[Optimus Prime (G1)|Optimus Prime]] | |||
*[[Starscream (G1)|Starscream]] | |||
}}</pre> | }}</pre> | ||
== Examples == | |||
=== Code === | |||
<pre> | |||
{{chapters | |||
|title=This uses style 1 | |||
|style=1 | |||
|content=*[[Optimus Prime (G1)|Optimus Prime]] | |||
}} | |||
</pre> | |||
=== Result === | |||
{{chapters | |||
|title=This uses style 1 | |||
|style=1 | |||
|content=*[[Optimus Prime (G1)|Optimus Prime]] | |||
}} | |||
=== Code === | |||
<pre> | |||
{{chapters | |||
|title=This uses style 2 | |||
|style=2 | |||
|content=*[[Optimus Prime (G1)|Optimus Prime]] | |||
}} | |||
</pre> | |||
=== Result === | |||
{{chapters | |||
|title=This uses style 2 | |||
|style=2 | |||
|content=*[[Optimus Prime (G1)|Optimus Prime]] | |||
}} | |||
=== Code === | |||
<pre> | |||
{{chapters | |||
|title=This uses style 3 | |||
|style=3 | |||
|content=*[[Optimus Prime (G1)|Optimus Prime]] | |||
}} | |||
</pre> | |||
=== Result === | |||
{{chapters | |||
|title=This uses style 3 | |||
|style=3 | |||
|content=*[[Optimus Prime (G1)|Optimus Prime]] | |||
}} | |||
=== Code === | |||
<pre> | |||
{{chapters | |||
|title=This is collapsible | |||
|collapsible=true | |||
|content=*[[Optimus Prime (G1)|Optimus Prime]] | |||
}} | |||
</pre> | |||
=== Result === | |||
{{chapters | |||
|title=This is collapsible | |||
|collapsible=true | |||
|content=*[[Optimus Prime (G1)|Optimus Prime]] | |||
}} | |||
=== Code === | |||
<pre> | |||
{{chapters | |||
|title=This has custom header colors | |||
|headerbgcolor=purple | |||
|headertextcolor=#FFFF00 | |||
|content=*[[Optimus Prime (G1)|Optimus Prime]] | |||
}} | |||
</pre> | |||
=== Result === | |||
{{chapters | {{chapters | ||
|title= | |title=This has custom header colors | ||
| | |headerbgcolor=purple | ||
|next= | |headertextcolor=#FFFF00 | ||
|content=*[[ | |content=*[[Optimus Prime (G1)|Optimus Prime]] | ||
*[[ | }} | ||
*[[ | === Code === | ||
*[[ | <pre>{{chapters|title=Christmas|prev=Halloween|next=January 1|center=true|align=left|float=none|style=2|collapsible=false|headerbgcolor=green|headertextcolor=red | ||
*[[ | |content=*[[Santa Claus]] | ||
*[[Christmas]] | |||
*[[Optimus Prime (G1)|Optimus Prime]] | |||
*[[Starscream (G1)|Starscream]] | |||
}}</pre> | |||
=== Result === | |||
{{chapters|title=Christmas|prev=Halloween|next=January 1|center=true|align=left|float=none|style=2|collapsible=false|headerbgcolor=green|headertextcolor=red | |||
|content=*[[Santa Claus]] | |||
*[[Christmas]] | |||
*[[Optimus Prime (G1)|Optimus Prime]] | |||
*[[Starscream (G1)|Starscream]] | |||
}} | }} | ||
<noinclude>[[Category: Externalized documentation]]</noinclude> | <noinclude>[[Category: Externalized documentation]]</noinclude> | ||
Latest revision as of 23:05, 10 June 2022
Description
[edit]{{chapters}} is used to create a "Chapter Navigation" item. It is the basis for many of our navigation templates.
Usage
[edit]Parameters
[edit]Required
[edit]- title - A title.
Optional
[edit]- prev - The article name to which the previous nav button should point.
- next - The article name to which the next nav button should point.
- center - Centers the entire box unit, default is true.
- align - Aligns the text within the main box. Options are left, right and center. Default is center.
- float - Sets the CSS float style. Make sure to set "center=false" if you want to float this!
- style - Sets the header to one of the three default color schemes shown below. Anything other than 2 or 3 will result in style 1. Style 3 matches episode and comic issue info boxes.
- collapsible - Set to true if you want the main box to be able to collapse to just the title
- headerbgcolor - Sets the color of the header to whatever HTML/CSS compatible color specification you want. This will override the background set by style.
- headertextcolor - Sets the text color of the header. If the title is a link, this will not work and the text will either be white by default or if you set style 3 it will be black.
- content - What to display under the title bar.
Code
[edit]{{chapters
|title=A Title
|prev=Previous
|next=Next
|center=true
|align=left
|float=none
|style=2
|collapsible=false
|headerbgcolor=red
|headertextcolor=green
|content=*[[Santa Claus]]
*[[Christmas]]
*[[Optimus Prime (G1)|Optimus Prime]]
*[[Starscream (G1)|Starscream]]
}}
Examples
[edit]Code
[edit]{{chapters
|title=This uses style 1
|style=1
|content=*[[Optimus Prime (G1)|Optimus Prime]]
}}
Result
[edit]| This uses style 1 | |||
|---|---|---|---|
Code
[edit]{{chapters
|title=This uses style 2
|style=2
|content=*[[Optimus Prime (G1)|Optimus Prime]]
}}
Result
[edit]| This uses style 2 | |||
|---|---|---|---|
Code
[edit]{{chapters
|title=This uses style 3
|style=3
|content=*[[Optimus Prime (G1)|Optimus Prime]]
}}
Result
[edit]| This uses style 3 | |||
|---|---|---|---|
Code
[edit]{{chapters
|title=This is collapsible
|collapsible=true
|content=*[[Optimus Prime (G1)|Optimus Prime]]
}}
Result
[edit]| This is collapsible | |||
|---|---|---|---|
Code
[edit]{{chapters
|title=This has custom header colors
|headerbgcolor=purple
|headertextcolor=#FFFF00
|content=*[[Optimus Prime (G1)|Optimus Prime]]
}}
Result
[edit]| This has custom header colors | |||
|---|---|---|---|
Code
[edit]{{chapters|title=Christmas|prev=Halloween|next=January 1|center=true|align=left|float=none|style=2|collapsible=false|headerbgcolor=green|headertextcolor=red
|content=*[[Santa Claus]]
*[[Christmas]]
*[[Optimus Prime (G1)|Optimus Prime]]
*[[Starscream (G1)|Starscream]]
}}
Result
[edit]| « | Christmas | » | |
|---|---|---|---|

