Template:Cells: Difference between revisions

From LifeWiki
Jump to navigation Jump to search
per tiki bar
Confocal (talk | contribs)
m nowrap displayed link text
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#if: {{{cells|{{{1|}}}}}} | {{#ifexpr: {{formatnum:{{{cells|{{{1|}}}}}}|R}} >= 1000 | [[:Category:Patterns with between {{#expr:10^{{#len:{{formatnum:{{{cells|{{{1|}}}}}}|R}}}} / 10}} and {{#expr:10^{{#len:{{formatnum:{{{cells|{{{1|}}}}}}|R}}}} - 1}} cells|{{{cells|{{{1|}}}}}}]] | {{#ifexpr: {{formatnum:{{{cells|{{{1|}}}}}}|R}} >= 200 | [[:Category:Patterns with between {{#sub:{{formatnum:{{{cells|{{{1|}}}}}}|R}}|0|1}}00 and {{#sub:{{formatnum:{{{cells|{{{1|}}}}}}|R}}|0|1}}99 cells|{{{cells|{{{1|}}}}}}]] | {{#ifexpr: {{formatnum:{{{cells|{{{1|}}}}}}|R}} >= 100 | [[:Category:Patterns with between 1{{#sub:{{formatnum:{{{cells|{{{1|}}}}}}|R}}|1|1}}0 and 1{{#sub:{{formatnum:{{{cells|{{{1|}}}}}}|R}}|1|1}}9 cells|{{{cells|{{{1|}}}}}}]] | [[:Category:Patterns with {{{cells|{{{1|}}}}}} cells|{{{cells|{{{1|}}}}}}]] }} }} }} | '''no cell count specified!''' }}</includeonly><noinclude>{{Template:Cells/Doc}} [[Category:Internal link templates]]</noinclude>
<includeonly>{{#if: {{{cells|{{{1|}}}}}} | {{nowrap|[[:Category:Patterns with {{CellsCategoryName|{{{cells|{{{1|}}}}}}}} cells|{{{text|{{{cells|{{{1|}}}}}}}}}]]}} | '''no cell count specified!''' }}</includeonly><noinclude>{{Template:Cells/Doc}} [[Category:Internal link templates]]</noinclude>

Latest revision as of 03:02, 8 October 2022

This template can be used to quickly and easily embed a link to the category of patterns with a given cell count. For example,

The frobnozzle is a {{cells|22}}-bit p3 oscillator.

becomes

The frobnozzle is a 22-bit p3 oscillator.

(This is much more convenient than having to type the equivalent of

The frobnozzle is a [[:Category:Patterns with 22 cells]]-bit p3 oscillator.

everytime you want to link to a cell count-based pattern category.)

The template takes a single parameter, which can be passed without a name or as cells=.

For numbers greater than 100, the relevant category is determined with the help of {{CellsCategoryName}}:

The frobnozzle is a {{cells|222}}-bit p3 oscillator.

becomes

The frobnozzle is a 222-bit p3 oscillator. (adds to Category:Patterns with between 200 and 299 cells)

It is also possible to provide an arbitrary displayed link text using the optional parameter text=:

The frobnozzle is a {{cells|7|text=seven-bit}} p3 oscillator.

becomes

The frobnozzle is a seven-bit p3 oscillator.