舰R百科是靠无数志愿编辑者持续地建设更新完善的。编辑非常简单,无需代码知识,请勇于更新页面!
编辑入门 | 资助百科 | 留言讨论页 | 微博@舰R百科 | 百科编辑讨论Q群:366818861

微件:ImgTag:修订间差异

舰R百科,玩家自由编辑的战舰少女R百科
跳转到导航 跳转到搜索
无编辑摘要
无编辑摘要
 
(未显示同一用户的25个中间版本)
第1行: 第1行:
<noinclude>
这个微件是<nowiki><img></nowiki>的微件实现,用来1.42版本之后MW不再支持wikitext内使用<nowiki><img></nowiki>,兼容百科上现存的外链图片。除非有很好的理由并经过管理确认,不应该使用这个微件引用任何新图片,而是应该把图片上传到百科然后使用wikitext引用图片。
使用:
<code><nowiki>
{{#widget:ImgTag|src=链接|width=宽度(默认auto)|height=高度(默认auto)}}
</nowiki></code>
所有可用参数:
* src
* alt
* width
* height
* style
* class
* loading
* decoding
* fetchpriority
* sizes
* srcset
* crossorigin
* referrerpolicy
</noinclude>
<includeonly>
<includeonly>
<img
<img
<!-- {if !empty($src)} -->
    <!--{* Required attribute *}-->
src="<!-- {$src} -->"
    <!--{if !empty($src)}-->src="<!--{$src|escape:'html'}-->"<!--{/if}-->
<!-- {/if} -->
 
    <!--{* Core attributes *}-->
    <!--{if !empty($alt)}-->alt="<!--{$alt|escape:'html'}-->"<!--{/if}-->
    <!--{if !empty($width)}-->width="<!--{$width|escape:'html'}-->"<!--{/if}-->
    <!--{if !empty($height)}-->height="<!--{$height|escape:'html'}-->"<!--{/if}-->
    <!--{if !empty($style)}-->style="<!--{$style|escape:'html'}-->"<!--{/if}-->
    <!--{if !empty($class)}-->class="<!--{$class|escape:'html'}-->"<!--{/if}-->
   
    <!--{* Loading behavior *}-->
    <!--{if !empty($loading)}-->loading="<!--{$loading|escape:'html'}-->"<!--{/if}-->
    <!--{if !empty($decoding)}-->decoding="<!--{$decoding|escape:'html'}-->"<!--{/if}-->
    <!--{if !empty($fetchpriority)}-->fetchpriority="<!--{$fetchpriority|escape:'html'}-->"<!--{/if}-->
 
    <!--{* Responsive image attributes *}-->
    <!--{if !empty($sizes)}-->sizes="<!--{$sizes|escape:'html'}-->"<!--{/if}-->
    <!--{if !empty($srcset)}-->srcset="<!--{$srcset|escape:'html'}-->"<!--{/if}-->
 
    <!--{* Security and privacy *}-->
    <!--{if !empty($crossorigin)}-->crossorigin="<!--{$crossorigin|escape:'html'}-->"<!--{/if}-->
    <!--{if !empty($referrerpolicy)}-->referrerpolicy="<!--{$referrerpolicy|escape:'html'}-->"<!--{/if}-->
/>
/>
</includeonly>
</includeonly>

2024年12月30日 (一) 23:39的最新版本

这个微件是<img>的微件实现,用来1.42版本之后MW不再支持wikitext内使用<img>,兼容百科上现存的外链图片。除非有很好的理由并经过管理确认,不应该使用这个微件引用任何新图片,而是应该把图片上传到百科然后使用wikitext引用图片。

使用: {{#widget:ImgTag|src=链接|width=宽度(默认auto)|height=高度(默认auto)}}

所有可用参数:

  • src
  • alt
  • width
  • height
  • style
  • class
  • loading
  • decoding
  • fetchpriority
  • sizes
  • srcset
  • crossorigin
  • referrerpolicy