Difference between revisions of "Template:StandardRestrictedStyle"

From TheKolWiki
Jump to: navigation, search
Line 35: Line 35:
 
|-
 
|-
 
| [[packaged knock-off retro superhero cape]]
 
| [[packaged knock-off retro superhero cape]]
| {{Template:StandardRestrictedStyle|year=2020}} | Nov. 2020
+
| {{Template:StandardRestrictedStyle|year=2020}} | Nov. 2020<br>(styling a cell)
(styling a cell)
+
 
|-
 
|-
 
| [[unopened diabolic pizza cube box]]
 
| [[unopened diabolic pizza cube box]]
Line 59: Line 58:
 
|-
 
|-
 
| [[packaged knock-off retro superhero cape]]
 
| [[packaged knock-off retro superhero cape]]
| {{Template:StandardRestrictedStyle|year=2020}} | Nov. 2020
+
| {{Template:StandardRestrictedStyle|year=2020}} | Nov. 2020<br>(styling a cell)
(styling a cell)
+
 
|-
 
|-
 
| [[unopened diabolic pizza cube box]]
 
| [[unopened diabolic pizza cube box]]

Revision as of 01:31, 10 November 2020


{{StandardRestrictedStyle}}
{{

#ifexpr: {{CURRENTYEAR}} - {{{year}}} <= 0 | style="background-color: #AAFFAA; {{{style|}}}" | {{ #ifexpr: {{CURRENTYEAR}} - {{{year}}} = 1 | style="background-color: #CCFF99; {{{style|}}}" | {{ #ifexpr: {{CURRENTYEAR}} - {{{year}}} = 2 | style="background-color: #FFFF77; {{{style|}}}" | style="background-color: #FFCCCC; {{{style|}}}" }} }}

}}

This is a template for applying common style(s) to any content subject to standard restrictions. The template picks the appropriate style based on the current year ({{CURRENTYEAR}}), so that all tables using this template will be automatically updated when the year changes.

This template is intended to be used only to specify the style of a table row or cell.

Due to how the wiki software (and HTML) works, you cannot use a style="" statement along with this template to specify additional styles. Instead, you must pass additional CSS styles using the style parameter.

Options

All arguments are keyword only.

  • year: Required. The year in which the current item, skill, or familiar was released. This is used to pick the correct style.
  • style: Optional. Additional CSS style(s) to apply.

Examples

{| class="wikitable" style="text-align: center"
! Item
! Released on
|-
| [[packaged knock-off retro superhero cape]]
| {{Template:StandardRestrictedStyle|year=2020}} | Nov. 2020<br>(styling a cell)
|-
| [[unopened diabolic pizza cube box]]
| {{Template:StandardRestrictedStyle|year=2019|style=text-align: right; font-weight: bold}} | Nov. 2019<br>(applying additional styles)
|- {{Template:StandardRestrictedStyle|year=2018}}
| [[voter registration form]]
| Nov. 2018<br>(styling entire rows)
|-
| [[pantogram]]
| {{Template:StandardRestrictedStyle|year=2017}} | Nov. 2017
|-
| [[Build-a-City Gingerbread kit]]
| {{Template:StandardRestrictedStyle|year=2016}} | Dec. 2016
|}

The above is rendered as:

Item Released on
packaged knock-off retro superhero cape Nov. 2020
(styling a cell)
unopened diabolic pizza cube box Nov. 2019
(applying additional styles)
voter registration form Nov. 2018
(styling entire rows)
pantogram Nov. 2017
Build-a-City Gingerbread kit Dec. 2016