Difference between revisions of "Template:InfoboxSimpleLine"

From Istaria Lexica

m (escape)
m (raw html to get rid of excess newlines)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly>{{#ifeq:{{{hide|}}} | true |<!--do nothing-->| {{#if:{{{name|}}} | {{#if:{{{value|}}} |
 
<includeonly>{{#ifeq:{{{hide|}}} | true |<!--do nothing-->| {{#if:{{{name|}}} | {{#if:{{{value|}}} |
{{!}}-
+
<tr>
{{!}} style="text-align:right; white-space: nowrap; width: 50%; {{#if:{{{style|}}} | {{{style}}};}}" {{!}} {{{name}}}
+
<td style="text-align:right; white-space: nowrap; width: 50%; {{#if:{{{style|}}} | {{{style}}};}}">{{{name}}}</td>
{{!}} {{#if:{{{style|}}} | style="{{{style}}}" {{!}} }}{{#if: {{{property|}}} | {{#ifeq:{{{silent|}}} | true | {{#set: {{{property}}}={{{value}}}}}{{{value}}} | [[{{{property}}}::{{{value}}}]]}} | {{{value}}}}}
+
<td {{#if:{{{style|}}} | style="{{{style}}}"}}>{{#if: {{{property|}}} | {{#ifeq:{{{silent|}}} | true | {{#set: {{{property}}}={{{value}}}}}{{{value}}} | [[{{{property}}}::{{{value}}}]]}} | {{{value}}}}}</td>
 +
</tr>
 
}} }} }}</includeonly><noinclude>{{Clr}}{{Documentation}}[[Category:Infobox Templates]][[Category:Non-standalone Templates]][[Category:Add Data Templates]]<noinclude>
 
}} }} }}</includeonly><noinclude>{{Clr}}{{Documentation}}[[Category:Infobox Templates]][[Category:Non-standalone Templates]][[Category:Add Data Templates]]<noinclude>

Latest revision as of 15:09, 11 November 2022

Template documentation (for the template shown above, sometimes hidden or invisible)

Description[edit]

Non-standalone template for use in certain infobox templates.

This template adds a line of key/value columns to a table (Like Template:InfoboxStart). Used mainly for complicated #if statements to avoid rendering and formatting issues (a workaround if you like..).

  • Find pages using this template
  • provides a two-columned key-value pair
  • provides table cell styling
  • auto-hides if either key or value are missing
  • can be forced to hide
  • provides Semantik MediaWiki properties
  • also provides hidden SMW annotations


Syntax[edit]

{{InfoboxSimpleLine|name=|value=|style=|property=|silent=|hide=}}

Parameters[edit]

{{InfoboxSimpleLine
|name     = Name of the value (i.e. Bulk, Price, Health, ...)
|value    = The value. May be a simple text or one or more links like [[Sandstone]]. Keep in mind that links will mess up the 'property' and 'silent' features!
|style    = Hand over a CSS style for the table cells (i.e. border: 1px solid black)
|property = Semantic MediaWiki property name for the value. NOTE: Do not use links in 'name' if using that.
|silent   = Set to true if you do not want the (property) value to be linked.
|hide     = Set to true if you want to force the row to be hidden at all times.

}}

Examples[edit]

Simple values:[edit]

{{InfoboxSimpleLine
|name   = Price:
|value  = 2s 350c
|style  = padding: 0
}}

Multiple and linked values[edit]

{{InfoboxSimpleLine
|name   = Attack types:
|value  = [[Flame]], [[Blight]]
|style  = background-color: lightgreen;
}}

SMW property, using the silent annotation[edit]

{{InfoboxSimpleLine
|name     = Attack Type:
|value    = Slash
|property = attack_type
|silent   = true
}}

Force-hide the whole row[edit]

{{InfoboxSimpleLine
|name     = Attack Type:
|value    = Slash
|property = attack_type
|silent   = true
|hide     = true
}}
Visit Template:InfoboxSimpleLine/doc to edit this text. (How to: document correctly)