Template:Chapters/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Removed the temporary preview.)
m (Preview and Value from Dictionary)
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{doc/subpage}}
{{doc/subpage}}
{{Note|Currently work in progress. But it can be used in most pages now.}}
This template is used to list all game chapters, campaign or missions. Chapters name (and titlebar itself) are also translated automatically, but users can add new translations on the [[/strings|strings subpage]].
{{Todo|Add {{code|mw-collapsible}} or something like that to hide more chapters by default unless users clicked on the Next button to see more chapters. Do not use {{t|Expand}} or {{t|ExpandBox}} with this as they made the article looks low quality.}}
 
This template is used to list all game chapters, campaign or missions. Chapters name (and titlebar itself) are also translated automatically (currently {{hl|4}} + {{bms|4}} only), but users can add new translations on the [[/strings|strings subpage]].
 
== Testcases ==
*For more examples, visit [[/testcases|Testcases]] page.


== Parameters ==
== Parameters ==
Line 12: Line 6:
! style="width:15%" | {{Dictionary/common|Param}}
! style="width:15%" | {{Dictionary/common|Param}}
! style="text-align:center" | {{Dictionary/common|Desc}}
! style="text-align:center" | {{Dictionary/common|Desc}}
! style="text-align:center" | Value
! style="text-align:center" | {{Dictionary/common|Value}}
! {{Dictionary/common|Previews}}
! {{Dictionary/common|Preview}}
|-
|-
| align="center" | None
| align="center" | None
| align="center" | Default appearance  
| align="center" | Default appearance<br><small>(''By default its expanded, for the documentation, its collapsed'')</small>
| N/A
| N/A
| {{Chapters}}
| {{Chapters|state=collapsed}}
|-
|-
| align="center" | {{Code|style=2|{{Param|type}}}}
| align="center" | {{Code|style=2|{{Param|game}}}}
| align="center" | Game name, uses anything that are based off {{t|Software}} template.
| align="center" | Game name, uses anything that are based off {{t|Software}} template.
| {{CodeBlock|margin=5px|<nowiki>| game = hl</nowiki>}}
| {{CodeBlock|margin=5px|<nowiki>| game = hl</nowiki>}}
| {{Chapters|game=hl}}
| {{Chapters|game=hl|state=collapsed}}
|-
|-
| align="center" | {{Code|style=2|{{Param|type}}}}
| align="center" | {{Code|style=2|{{Param|type}}}}
| align="center" | Changes the title bar to Chapters, campaigns or missions.
| align="center" | Changes the title bar to Chapters, campaigns or missions.
| {{CodeBlock|margin=5px|<nowiki>| type = chapters</nowiki>}}{{CodeBlock|margin=5px|<nowiki>| type = camp</nowiki>}}{{CodeBlock|margin=5px|<nowiki>| type = missions</nowiki>}}
| {{CodeBlock|margin=5px|<nowiki>| type = chapters</nowiki>}}{{CodeBlock|margin=5px|<nowiki>| type = camp</nowiki>}}{{CodeBlock|margin=5px|<nowiki>| type = missions</nowiki>}}
| {{Chapters|game=l4d|type=camp}}
| {{Chapters|game=l4d|type=camp|state=collapsed}}
|-
| align="center" | {{Code|style=2|{{Param|state}}}} ~ {{Code|style=2|{{Param|state<?>}}}}
| align="center" | Collapses the chapters. <br>(<code><?></code>: Unknown amount of states, used in "Template:Chapters/<game name>")
| {{CodeBlock|margin=5px|<nowiki>| state = collapsed</nowiki>}}<br>{{CodeBlock|margin=5px|<nowiki>| state1 = collapsed</nowiki>}}
| {{Chapters|game=hla|type=camp|state=collapsed}}{{Chapters|game=l4d2|type=camp|state1=collapsed}}
|-
|-
|}
|}

Latest revision as of 10:02, 15 September 2025

Edit-copy.png
This is a documentation subpage for Template:Chapters.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

This template is used to list all game chapters, campaign or missions. Chapters name (and titlebar itself) are also translated automatically, but users can add new translations on the strings subpage.

Parameters

Parameter Description Value Preview
None Default appearance
(By default its expanded, for the documentation, its collapsed)
N/A
{{{game}}} Game name, uses anything that are based off {{Software}} template.
| game = hl
{{{type}}} Changes the title bar to Chapters, campaigns or missions.
| type = chapters
| type = camp
| type = missions
{{{state}}} ~ {{{state<?>}}} Collapses the chapters.
(<?>: Unknown amount of states, used in "Template:Chapters/<game name>")
| state = collapsed

| state1 = collapsed