Template:TableAttributeNew: Difference between revisions

From The Seven Sages of Rome
Created page with "<noinclude> == Usage == <nowiki> {{TableAttribute |type=[file,text,attr,list] |display_name=the displayed name |value=the value to set |property=the property name |form=the form to link to |padding=padding on the left (hierarchy depth in px) }} </nowiki> </noinclude> <includeonly>{{#if:{{{value|}}}|<div class="ms-attr-row{{#if:{{{padding|}}}| ms-attr-row--child}}"> <div class="ms-attr-label"{{#if:{{{padding|}}}| style="padding-left: {{{padding}}}px"}}>{{#if:{{{padding|}}..."
 
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 2: Line 2:
== Usage ==
== Usage ==
<nowiki>
<nowiki>
{{TableAttribute
{{TableAttributeNew
|type=[file,text,attr,list]
|type=[file,text,attr,list]
|display_name=the displayed name
|display_name=the displayed name
Line 8: Line 8:
|property=the property name
|property=the property name
|form=the form to link to
|form=the form to link to
|padding=padding on the left (hierarchy depth in px)
|padding=padding depth (1,2,3,4)
|label=hide (optional, omits the label column for single-value cards)
}}
}}
</nowiki>
</nowiki>
</noinclude>
 
<includeonly>{{#if:{{{value|}}}|<div class="ms-attr-row{{#if:{{{padding|}}}| ms-attr-row--child}}">
Renamed from TableAttribute for scoped testing.
<div class="ms-attr-label"{{#if:{{{padding|}}}| style="padding-left: {{{padding}}}px"}}>{{#if:{{{padding|}}}|<span class="ms-attr-indent"></span>}}{{{display_name|}}}</div>
</noinclude><includeonly>{{#if:{{{value|}}}|<div class="cc-attr-row" {{#if:{{{padding|}}}|style="--depth:{{{padding}}}"}}>{{#ifeq:{{{label|}}}|hide||<div class="cc-attr-label" {{#if:{{{padding|}}}|data-depth="{{{padding|}}}"}}><span class="cc-attr-label-inner">{{{display_name|}}}</div>}}<div class="cc-attr-value">{{#switch:{{{type|}}}|file=[[File:{{{value}}}|thumbnail|{{{value}}}]]|text={{#set:{{{property|}}}={{{value|}}}}}{{#if:{{{form|}}}|{{#formredlink:target={{{value|}}}|form={{{form|}}}}}|{{{value|}}}}}|attr={{#set:{{{property|}}}={{{value|}}}}}{{#if:{{{form|}}}|{{#formredlink:target={{{value|}}}|form={{{form|}}}}}|[[{{{value|}}}]]}}|list={{#arraymap:{{{value|}}}|;|x|{{#set:{{{property|}}}=x}}{{#if:{{{form|}}}|{{#formredlink:target=x|form={{{form|}}}}}|x}}|,&nbsp;}}|#default={{{value|}}}}}</div></div>}}</includeonly>
<div class="ms-attr-value">{{#switch:{{{type|}}}
| file = [[File:{{{value}}}|thumbnail|{{{value}}}]]
| text = {{#set:{{{property|}}}={{{value|}}}}}{{#if:{{{form|}}}|{{#formredlink:target={{{value|}}}|form={{{form|}}}}}|{{{value|}}}}}
| attr = {{#set:{{{property|}}}={{{value|}}}}}{{#if:{{{form|}}}|{{#formredlink:target={{{value|}}}|form={{{form|}}}}}|[[{{{value|}}}]]}}
| list = {{#arraymap:{{{value|}}}|;|x|{{#set:{{{property|}}}=x}}{{#if:{{{form|}}}|{{#formredlink:target=x|form={{{form|}}}}}|x}}|,&nbsp;}}
| #default = {{{value|}}}
}}</div>
</div>|}}</includeonly>

Latest revision as of 08:50, 26 February 2026

Usage

{{TableAttributeNew |type=[file,text,attr,list] |display_name=the displayed name |value=the value to set |property=the property name |form=the form to link to |padding=padding depth (1,2,3,4) |label=hide (optional, omits the label column for single-value cards) }}

Renamed from TableAttribute for scoped testing.