Template:TableAttribute: Difference between revisions

From The Seven Sages of Rome
No edit summary
Tag: Reverted
No edit summary
Tag: Manual revert
 
Line 13: Line 13:
</noinclude>
</noinclude>
<includeonly>
<includeonly>
{{#if:{{{value|}}}|
| {{#if:{{{padding|}}}|style="padding-left: {{{padding|}}}px; background: #f5f5f5" {{!}}└|}} '''{{{display_name|}}}''' || {{#switch:{{{type|}}}
| {{#if:{{{padding|}}}|style="padding-left: {{{padding|}}}px; background: #f5f5f5" {{!}}└|}} '''{{{display_name|}}}''' || {{#switch:{{{type|}}}
| file = {{#if:{{{value|}}}|[[File:{{{value}}}|thumbnail|{{{value|}}}]]}}
| file = {{#if:{{{value|}}}|[[File:{{{value}}}|thumbnail|{{{value|}}}]]}}
Line 20: Line 19:
| list = {{#arraymap:{{{value|}}}|;|x|{{#set:{{{property|}}}=x}}{{#if:{{{form|}}}|{{#formredlink:target=x|form={{{form|}}}}}|x}}|,&nbsp;}}
| list = {{#arraymap:{{{value|}}}|;|x|{{#set:{{{property|}}}=x}}{{#if:{{{form|}}}|{{#formredlink:target=x|form={{{form|}}}}}|x}}|,&nbsp;}}
| #default = {{#if:{{{value|}}}|{{{value|}}}}}
| #default = {{#if:{{{value|}}}|{{{value|}}}}}
}}|}}
}}
|-
|-
</includeonly>
</includeonly>

Latest revision as of 17:05, 12 March 2025

Usage

{{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 }}