Widget:Wikipedia image
From CruisersWiki
(Difference between revisions)
(escape) |
|||
(17 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
- | <includeonly><!-- | + | <includeonly><!--{ |
- | + | assign var="fileEscaped" value=$file|replace:' ':'_'|escape:'url' | |
- | --><!--{assign var="link" value=$link|default:"http:// | + | }--><!--{ |
- | --><!--{assign var=" | + | assign var="link" value=$link|default:"http://wikipedia.org/wiki/File:$fileEscaped" |
- | --><!--{if !$nolink | + | }--><!--{ |
- | + | assign var="width" value=$width|regex_replace:'/^([0-9]*).*$/':'\1' | |
- | --><!--{ | + | }--><!--{ |
- | + | assign var="height" value=$height|regex_replace:'/^([0-9]*).*$/':'\1' | |
- | --><!--{if !$ | + | }--><!--{ |
- | + | assign var="noSvg" value=$file|regex_replace:'/\.svg$/':'' | |
- | --><!--{/if}--><!-- | + | }--><!--{ |
- | --></ | + | if !$nolink |
- | <!-- | + | }--><a href="<!--{$link}-->" class="image"><!--{ |
+ | /if | ||
+ | }--><img <!--{if $thumb}-->class="thumbimage" <!--{/if}-->alt="<!--{$file|escape}-->" src="https://en.wikipedia.org/wiki/Special:Redirect/file/<!--{$fileEscaped}--><!--{ | ||
+ | if $file == $noSvg | ||
+ | }-->?dummy<!--{if $width}-->&width=<!--{$width}--><!--{/if}--><!--{if $height}-->&height=<!--{$height}--><!--{/if}--><!--{ | ||
+ | /if | ||
+ | }-->"<!--{if $width}--> width="<!--{$width}-->"<!--{/if}--><!--{if $height}--> height="<!--{$height}-->"<!--{/if}-->><!--{ | ||
+ | if !$nolink | ||
+ | }--></a><!--{ | ||
+ | /if | ||
+ | }--></includeonly><noinclude> | ||
- | + | A helper widget for [[Template:Wikipedia image]] | |
- | < | + | <!-- https://doc.wikimedia.org/mediawiki-core/master/php/SpecialRedirect_8php_source.html --> |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | --> | + | |
</noinclude> | </noinclude> |
Latest revision as of 13:39, 3 March 2019
A helper widget for Template:Wikipedia image