Template:Infobox element/symbol-to-block/format2

From HandWiki
< Template:Infobox element‎ | symbol-to-block
Revision as of 19:36, 14 October 2021 by imported>MainEditor (Created page with "{{#if:{{in string|1=_{{{format|}}}_|2=%Wptsort%W|nomatch=|plain=false}}|<!-- SORT-KEY 1. block order 2. Z order -->data-sort-value="{{#expr:{{#switch:{{{value-long|}}} | s-b...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Template documentation[view] [edit] [history] [purge]

Usage

{{Infobox element/symbol-to-block|symbol=}}
default: returns plain text: s-block, p-block, d-block, f-block, g-block, h-block, i-block

Formatting options

  • |format=letter
Returns bare letter: s, p, d, f, or g: Hg → d
  • |format=wl
Returns wikilink, like [[Block (periodic table)#s-block|s-block]]
  • |format=wlfirst
Returns wikilink when first mentioned in Z-order (= H, B, Sc, La, Ubu → s, p, d, f, g)
  • |format=bgcolor (tablecell)
Returns background color for block, used in tablecell
{{Infobox element/symbol-to-block|symbol=Hg |format=bgcolor }} → #99ccff
  • |format=ptsort, pipe (in tablecell)
Adds a hidden sort-key to order: 1. by block s<p<d<f<g, 2. per block: by Z.
{{Infobox element/symbol-to-block|symbol=Hg |format=ptsort, pipe}}data-sort-value="3080" | d-block
Applied in § Overview below.

Format parameters can be combined using comma's:

  • |format=letter, wl
for Hg: → d

settings

>= E121: | Ubu | Ubb | Ubt | Ubq | Ubp | Ubh = g-block
Background colors returned

{{Element color}} (definition) → {{Infobox element/symbol-to-block}} (following)

  •    s-block → #ff9999  = #ff9999
  •    p-block → #fdff8c  = #fdff8c
  •    d-block → #99ccff  = #99ccff
  •    f-block → #9bff99  = #9bff99
  •    g-block → #fd99ff  = #fd99ff
  •    h-block → transparent  = #ddd not implemented
  •    i-block → transparent  = #ddd not implemented

Overview

{{Infobox element/symbol-to--overview-properties}}


Checks whether {{ROOTPAGENAME}} = {{PAGENAME}}

Note: namespace is not checked. So: "Template:Foo" and "Category:Foo" test positive.

Usage

Main usage: in {{documentation}} subpage. To prevent subtemplates that use the same doc page to categorise.

See also

Template:Namespace and pagename-detecting templates