Template talk:Chapters

From Valve Developer Community
Jump to navigation Jump to search

Top row background color

{{table
|	{{tr
	|	{{th|colspan=3|bgcolor=rgba(0,0,0,0.5)|{{hl2|4}} Chapters}}
	|	bgcolor={{{{{game|hl2}}}|col}}
	}}
	<!-- ... -->
}}

Apparently you'd like to use a fitting background color for the top row for each game. Instead of hard coding it for each game, like #403305 that you used for hl2, you can - if it fits to your plans - make use of {{Hl2|col}} for that matter, or more precisely: {{{{{game}}}|col}}. Using this, the background color adapts to the {{{game}}}. Using a second half transparent black background color, you can darken the game's color. This should work out as long as the game color is not too dark. :)

In addition, this would mean that you don't need to #switch for the game right at the beginning of the template (in which case you could also just make a template for each game's chapters), instead after the table's top row. That should decrease redundance at least a bit.
--popcorn (talk) 14:38, 25 July 2023 (PDT)

Thanks for that edit. :) kr0tchet (talk) 08:34, 26 July 2023 (PDT)

Adding a collapsible to the table

I finally was able to make it work, but not how the todo wants it, because of how it implements the elements, so this is the example from Template:Chapters/sandbox:

Although there can be an option like {{{state}}} to set it collapsed or not, since centering the title is shit but atleast it works.

(Edit: added a state on the sandbox now the chapters is collapsed) --N0one (talk) 10:44, 27 May 2025 (PDT)

Typo that I don't know where to fix.

"This template uses a Testcases subpage
You can test how this page looks with it's different skins and parsers." Where is the template that contains this so that I (or someone else) can fix the typo? "it's" should be "its". Dogman15 (talk) 02:55, 3 November 2025 (PST)