Template:Chapters: Difference between revisions
From MediaWiki
Jump to navigationJump to search
Tigerpaw28 (talk | contribs) Fixing logic for real |
Tigerpaw28 (talk | contribs) Undo revision 1450012 by Tigerpaw28 (talk) This was wrong |
||
| Line 1: | Line 1: | ||
<includeonly>{| class="tt1_chapters {{#ifeq:{{{collapsible | <includeonly>{| class="tt1_chapters {{#ifeq:{{{collapsible}}}|true|mw-collapsible mw-collapsed}}" style="{{#ifeq:{{{center|}}}|false||margin-left:auto;margin-right:auto;}}{{#if:{{{float|}}}|float:{{{float}}};|}}" | ||
|- class="tt1_chapters-header tt1_secondarynav{{#if:{{{style|}}}|<nowiki> </nowiki>style{{{style}}}|}}" {{#if:{{{headerbgcolor|}}}|style="background-color:{{{headerbgcolor}}}"}} | |- class="tt1_chapters-header tt1_secondarynav{{#if:{{{style|}}}|<nowiki> </nowiki>style{{{style}}}|}}" {{#if:{{{headerbgcolor|}}}|style="background-color:{{{headerbgcolor}}}"}} | ||
| class="tt1-navigation_franchise-prev tti_buttonlink" |{{#if:{{{prev|}}}|[[{{{prev}}}|«]]|}} | | class="tt1-navigation_franchise-prev tti_buttonlink" |{{#if:{{{prev|}}}|[[{{{prev}}}|«]]|}} | ||
Latest revision as of 03:03, 10 October 2020
(Transcluded documentation: view)
Description
{{chapters}} 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
{{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
Code
{{chapters
|title=This uses style 1
|style=1
|content=*[[Optimus Prime (G1)|Optimus Prime]]
}}
Result
| This uses style 1 | |||
|---|---|---|---|
Code
{{chapters
|title=This uses style 2
|style=2
|content=*[[Optimus Prime (G1)|Optimus Prime]]
}}
Result
| This uses style 2 | |||
|---|---|---|---|
Code
{{chapters
|title=This uses style 3
|style=3
|content=*[[Optimus Prime (G1)|Optimus Prime]]
}}
Result
| This uses style 3 | |||
|---|---|---|---|
Code
{{chapters
|title=This is collapsible
|collapsible=true
|content=*[[Optimus Prime (G1)|Optimus Prime]]
}}
Result
| This is collapsible | |||
|---|---|---|---|
Code
{{chapters
|title=This has custom header colors
|headerbgcolor=purple
|headertextcolor=#FFFF00
|content=*[[Optimus Prime (G1)|Optimus Prime]]
}}
Result
| This has custom header colors | |||
|---|---|---|---|
Code
{{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
| « | Christmas | » | |
|---|---|---|---|

