Difference between revisions of "Template:Image dimensions"
Dinoguy1000 (talk | contribs) (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="{{ # | + | <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> |