Template:InfoboxStart: Difference between revisions

From LifeWiki
Jump to navigation Jump to search
Let's make that non-optional for now
Experimental change to templates per agreement at https://conwaylife.com/forums/viewtopic.php?p=166781#p166781 -- issue not considered resolved until (at minimum) review in a week or two
Tag: Undo
 
(26 intermediate revisions by 6 users not shown)
Line 3: Line 3:
Display "request pattern file" box if no pattern files exist and "nofile" was not passed to suppress this
Display "request pattern file" box if no pattern files exist and "nofile" was not passed to suppress this


--> {{#if: {{{zip|}}}{{{mc|}}}{{{life105|}}}{{{life106|}}}{{{plaintext|}}}{{{rle|}}}{{{nofile|}}} | | {{requestpatternfile}} }}<!--
--><!-- {{#if: {{{zip|}}}{{{mc|}}}{{{life105|}}}{{{life106|}}}{{{plaintext|}}}{{{rle|}}}{{{nofile|}}} | | {{requestpatternfile}} }} --><!--


Begin infobox proper
Begin infobox proper


--> <table class="infobox">
--> <table class="infobox">
<tr><td colspan="2" class="infobox_head"> {{{name|{{{typename|}}} Name}}} </td></tr>
<tr><td colspan="2" class="infobox_head"> {{#if: {{{name|}}} | {{{name}}} | {{{typename|}}} Name }} </td></tr>
<!--
<!--


Display infobox image or LifeViewer
Display infobox image or LifeViewer, if not specifically hidden


--><tr>
-->{{#if: {{{hideimg|}}} || <tr>
<td colspan="2" class="infobox_img"><table class="img_border" cellpadding="0"><tr><td>{{#if: {{{zip|}}}{{{mc|}}}{{{life105|}}}{{{life106|}}}{{{plaintext|}}}{{{rle|}}}{{{nofile|}}} | {{#ifexist:RLE:{{{pname}}}|{{LV:Viewer|{{RLE:{{{pname}}}}}
<td colspan="2" class="infobox_img"><table class="img_border" cellpadding="0"><tr><td>{{#if: {{{zip|}}}{{{mc|}}}{{{life105|}}}{{{life106|}}}{{{plaintext|}}}{{{rle|}}}{{{nofile|}}} | {{#ifexist:RLE:{{{pname}}}|{{LV:Viewer|{{RLE:{{{pname}}}}}
{{LifeViewer config/{{{defaultconfig|}}}}}
{{LifeViewer config/default}}{{#ifexist:Template:LifeViewer config/{{{defaultconfig|}}} |
{{#tag:nowiki|{{{viewerconfig|}}}}} | [[Image:{{{pname|}}}.png|{{{name}}} image]] }} | [[Image:{{{pname|}}}.png|{{{name}}} image]] }} | [[Image:UnknownPattern.png|{{{name}}} image]] }}</td></tr></table></td></tr><!--
{{LifeViewer config/{{{defaultconfig|}}}}} }}
{{#tag:nowiki|{{{viewerconfig|}}}}} | [[Image:{{{pname|}}}.png|{{{name}}} image]] }} | [[Image:{{{pname|}}}.png|{{{name}}} image]] }} | [[Image:UnknownPattern.png|{{{name}}} image]] }}</td></tr></table></td></tr> }}<!--


Display animated image link (if any)
Display animated image link (if any)
Line 28: Line 29:
Display "Manipulate via Java" link (disabled)
Display "Manipulate via Java" link (disabled)


--><!-- {{#if: {{{rle|}}} | <tr><td colspan="2" class="infobox_link"> [http://www.conwaylife.com?p={{{pname|name}}} Manipulate via Java] </td></tr> }} --><!--
--><!-- {{#if: {{{rle|}}} | <tr><td colspan="2" class="infobox_link"> [https://www.conwaylife.com?p={{{pname|name}}} Manipulate via Java] </td></tr> }} --><!--
 
Categories
 
-->{{#if:{{NAMESPACE}}||
[[Category:Patterns]] {{#ifexist:RLE:{{{pname}}} | {{#if:{{{viewerconfig|}}} | | [[Category:Patterns with RLE snippets but no LifeViewer configuration]] }} }}
}}<!--


Documentation
Documentation
Line 38: Line 45:


* '''typename''': a human-readable name of the type of pattern being displayed, e.g. "Still Life".
* '''typename''': a human-readable name of the type of pattern being displayed, e.g. "Still Life".
* '''defaultconfig''': the name of a subpage of [[Template:LifeViewer config]] holding the default LifeViewer configuration for this type of pattern, e.g. "stilllife".
* '''defaultconfig''': the name of [[:Category:LifeViewer default configs|a subpage]] of "Template:LifeViewer config" holding the default LifeViewer configuration for this type of pattern, e.g. "stilllife".


All other parameters should simply be passed through by the transcluding template.
All other parameters should simply be passed through by the transcluding template.


[[Category:Infobox templates]]
[[Category:Infobox subtemplates]]
</noinclude>
</noinclude>

Latest revision as of 15:18, 10 September 2023

This template starts the infobox on the right hand side of pattern pages, and displays the pattern's name, image and LifeViewer (if any). It should not be used on its own, but only within other pattern infobox templates such as Template:Pattern and Template:Oscillator.

It supports the following parameters:

  • typename: a human-readable name of the type of pattern being displayed, e.g. "Still Life".
  • defaultconfig: the name of a subpage of "Template:LifeViewer config" holding the default LifeViewer configuration for this type of pattern, e.g. "stilllife".

All other parameters should simply be passed through by the transcluding template.