Difference between revisions of "Template:InfoboxSimpleLine"
From Istaria Lexica
Line 1: | Line 1: | ||
<includeonly>|- {{#ifeq:{{{hide|}}} | true | style="display: none;" | {{#if:{{{name|}}} | {{#if:{{{value|}}} |<!--do nothing-->| style="display: none;" }} | style="display: none;"}} }} | <includeonly>|- {{#ifeq:{{{hide|}}} | true | style="display: none;" | {{#if:{{{name|}}} | {{#if:{{{value|}}} |<!--do nothing-->| style="display: none;" }} | style="display: none;"}} }} | ||
| style="text-align:right; white-space: nowrap; width: 50%; {{#if:{{{style|}}} | {{{style}}};}}" | {{#if: {{{name|}}} | {{{name}}}}} | | style="text-align:right; white-space: nowrap; width: 50%; {{#if:{{{style|}}} | {{{style}}};}}" | {{#if: {{{name|}}} | {{{name}}}}} | ||
− | | {{#if:{{{style|}}} | style="{{{style}}}" {{!}} }}{{#if: {{{value|}}} | {{#if: {{{property|}}} | {{#ifeq:{{{silent|}}} | true | {{#set: {{{property}}}={{{value}}}}}{{{value}}} | [[{{{property}}}::{{{value}}}]]}} | {{{value}}}}} }}</includeonly><noinclude>{{Clr}}{{Documentation}}[[Category:Infobox Templates]][[Category:Non-standalone Templates]]<noinclude> | + | | {{#if:{{{style|}}} | style="{{{style}}}" {{!}} }}{{#if: {{{value|}}} | {{#if: {{{property|}}} | {{#ifeq:{{{silent|}}} | true | {{#set: {{{property}}}={{{value}}}}}{{{value}}} | [[{{{property}}}::{{{value}}}]]}} | {{{value}}}}} }}</includeonly><noinclude>{{Clr}}{{Documentation}}[[Category:Infobox Templates]][[Category:Non-standalone Templates]][[Category:Add Data Templates]]<noinclude> |
Revision as of 18:47, 21 October 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)