Widget:Wikipedia image
From CruisersWiki
(Difference between revisions)
(Created page with "<includeonly><!-- --><!--{assign var="fileEscaped" value=$file|replace:' ':'_'|escape:'url'}--><!-- --><!--{assign var="link" value=$link|default:"http://commons.wikimedia.org/wi...") |
(escape) |
||
(18 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://wikipedia.org/wiki/File:$fileEscaped" |
- | + | }--><!--{ | |
- | + | assign var="width" value=$width|regex_replace:'/^([0-9]*).*$/':'\1' | |
- | + | }--><!--{ | |
- | --><!--{/ | + | assign var="height" value=$height|regex_replace:'/^([0-9]*).*$/':'\1' |
- | + | }--><!--{ | |
- | + | assign var="noSvg" value=$file|regex_replace:'/\.svg$/':'' | |
- | --><!--{ | + | }--><!--{ |
- | + | if !$nolink | |
- | --><!--{if | + | }--><a href="<!--{$link}-->" class="image"><!--{ |
- | + | /if | |
- | --><!--{/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