Jump to content

Template:External media and Template:External media/sandbox: Difference between pages

(Difference between pages)
Page 1
Page 2
Content deleted Content added
make float=center option actually work after testing in the sandbox
 
This may be better. "{{#ifexpr:{{Str find|" is less verbose than "{{#ifeq:{{#invoke:String|find|".
 
Line 1: Line 1:
{{Infobox
{{ infobox
| decat = yes <!-- track empty rows through a separate process -->
| decat = yes <!-- track empty rows through a separate process -->
| bodystyle = {{#if:{{{width|}}}|width: {{{width}}};}} <!--
| bodystyle = {{#if:{{{width|}}}|width: {{{width}}};}} clear: {{#switch:{{{float|}}}|none=both|#default={{{float|right}}} }}; {{#switch:{{{float|}}}|left=float:left;margin:0 1.5em 1.5em 0;|center=float:none;margin:auto|none=float:none;margin:0 0 1.5em 1.5em|right|#default=float:right;margin:0 0 1.5em 1.5em}}
Check if either align or float are specified:
-->{{#if:{{{align|}}}{{{float|}}}|<!--
If either align or float is "left":
-->{{#ifexpr:{{Str find|{{{align|}}}{{{float|}}}|left}} > 0|
float:left; clear:left; margin:0 1.5em 1.5em 0;
|}}<!--
If either align or float is "center":
-->{{#ifexpr:{{Str find|{{{align|}}}{{{float|}}}|center}} > 0|
float:none; clear:none; margin:auto;
|}}<!--
If float is "none":
-->{{#ifeq:{{{float|}}}|none|
float:none; clear:none;
|}}<!--
If either align or float is "right":
-->{{#ifexpr:{{Str find|{{{align|}}}{{{float|}}}|right}} > 0|
float:right; clear:right; margin:0 0 1.5em 1.5em;
|}}<!--
If both align and float are not specified:
--> |
float:right; clear:right; margin:0 0 1.5em 1.5em;
}}
| above = {{{title|{{#if:{{{image1|}}}{{{images|}}}|{{#if:{{{audio1|}}}{{{video1|}}}{{{model1|}}}|External media|External {{#if:{{{image2|}}}{{{images|}}}|images|image}} }}|{{#if:{{{audio1|}}}|{{#if:{{{video1|}}}{{{model1|}}}|External media|External audio}}|{{#if:{{{video1|}}}|{{#if:{{{model1|}}}|External media|External {{#if:{{{video1|}}}|videos|video}}}}|{{#if:{{{model1|}}}|External 3D {{#if:{{{model2|}}}|models|model}} }} }} }} }} }}}
| above = {{{title|{{#if:{{{image1|}}}{{{images|}}}|{{#if:{{{audio1|}}}{{{video1|}}}{{{model1|}}}|External media|External {{#if:{{{image2|}}}{{{images|}}}|images|image}} }}|{{#if:{{{audio1|}}}|{{#if:{{{video1|}}}{{{model1|}}}|External media|External audio}}|{{#if:{{{video1|}}}|{{#if:{{{model1|}}}|External media|External {{#if:{{{video1|}}}|videos|video}}}}|{{#if:{{{model1|}}}|External 3D {{#if:{{{model2|}}}|models|model}} }} }} }} }} }}}
| abovestyle = font-size:115%
| abovestyle = font-size:115%