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 |
||
| Line 2: | Line 2: | ||
== Usage == | == Usage == | ||
<nowiki> | <nowiki> | ||
{{ | {{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 | |padding=padding depth (1,2,3,4) | ||
}} | }} | ||
</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" | </noinclude><includeonly>{{#if:{{{value|}}}|<div class="ms-attr-row{{#if:{{{padding|}}}| ms-attr-row--child ms-depth-{{{padding}}}}}"><div class="ms-attr-label"><span class="ms-attr-label-inner">{{{display_name|}}}</span></div><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}}|, }}|#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}}|, }} | |||
| #default = {{{value|}}} | |||
}}</div> | |||
</div> | |||
Revision as of 17:30, 25 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) }}
Renamed from TableAttribute for scoped testing.