Permanently protected template

Difference between revisions of "Template:Image dimensions"

From Yugipedia
Jump to: navigation, search
(remove namespace from the filename in the event it's given)
(top: Restoring revision 4967038 by User:Dinoguy1000 on 2022-05-01 18:36:03. fix for images that have certain characters in their name (spaces and/or apostrophes, possibly others - see Doppel-ganger); tweak preload for nonuploaded images)
(Tag: New user edit)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<includeonly>{{ #vardefine: $id-name | {{PAGENAME:{{{1}}}}} }}<span class="image-dimensions" data-width="{{ #imgw: {{ #var: $id-name }} }}" data-height="{{ #imgh: {{ #var: $id-name }} }}">[[Media:{{ #var: $id-name }}|{{{2|}}}]]</span></includeonly><noinclude>
+
<includeonly><!--
 +
`id` used below is short for "image dimensions". A prefix to stop variable names conflicting with other templates.
 +
-->{{ #vardefine: $id-name | {{Normalized pagename|{{PAGENAME:{{{1}}}}}}} }}<!--
 +
-->{{ #ifeq: {{ #vardefineecho: $id-width | {{ #imgw: {{ #var: $id-name }} }} }} | 0
 +
| <span class="image-dimensions plainlinks">[{{fullurl:Special:Upload|wpDestFile={{ #var: $id-name }}&wpUploadDescription={{ urlencode: {{((}}OCG-TCG card image
 +
{{!}} name = {{Normalized pagename|{{PAGENAME}}}}
 +
{{))}} }}}} <span style="color: #ba0000;">{{{2|}}}</span>]</span>
 +
| <span class="image-dimensions" data-width="{{ #var: $id-width }}" data-height="{{ #imgh: {{ #var: $id-name }} }}" data-image_name="{{ #var: $id-name }}" data-filepath="{{filepath:{{ #var: $id-name }}}}">{{ #if: {{{raw|}}}
 +
  | {{{2|}}}
 +
  | [{{filepath:{{ #var: $id-name }}}} {{{2|}}}]
 +
  }}</span>
 +
}}</includeonly><noinclude>
 
{{documentation}}</noinclude>
 
{{documentation}}</noinclude>

Latest revision as of 22:47, 17 March 2023