打开/关闭菜单
331
1.7K
131
11.8K
星露谷物语扩展百科
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

模板:Weather inline:修订间差异

来自星露谷物语扩展百科
Nebulous Maestress留言 | 贡献
m +synonym
Nebulous Maestress留言 | 贡献
m sync with english template
第26行: 第26行:
-->{{#arraydefine:$wlink_text|{{ParseInputValues|code=weather|@weather@|translate=true}}}}<!--
-->{{#arraydefine:$wlink_text|{{ParseInputValues|code=weather|@weather@|translate=true}}}}<!--


// On first entry, add sort-key if requested. On other entries, add space and bullet.
// Wrap a sort-key span around all items if requested. On other entries, add {{{space}}} or bullet.
-->{{#ifexpr:{{#arraysearch:$wweather|@weather@}}>0
-->{{#ifexpr:{{#arraysearch:$wweather|@weather@}}>0
     |&#32;•&#32;
     |{{{space|&#32;•&#32;}}}
     |{{#if:{{{sortkey|}}}|
     |{{#ifexpr:{{#if:{{{sortkey|}}}|1|0}} or {{#ifeq:{{{sortkey}}}||1|0}}
         <span class="sortkey" style="display:none;">{{#if:{{#arrayprint:$wlink_text}}
         |<span data-sort-value="{{#ifeq:{{{sortkey}}}|||{{#ifeq:{{{sortkey|true}}}|true
  |{{#expr:{{ParseInputValues|code=weather|@weather@|translate=index}}+1}}
          |{{#expr:{{#if:{{#arrayprint:$wlink_text}}
  |0}}</span>
            |({{ParseInputValues|code=weather|@weather@|translate=index}}+1)
    |0}}}}
          |{{{sortkey|}}}}}}}">
   }}}}<span style="display:inline; margin-right:0; white-space: nowrap"><!--
   }}}}<span style="display:inline; margin-right:0; white-space: nowrap"><!--


第49行: 第51行:
// Add link
// Add link
-->[[{{#arrayprint:$lang_weatherlink}}|{{#arrayprint:$wlink_text}}]]<!--
-->[[{{#arrayprint:$lang_weatherlink}}|{{#arrayprint:$wlink_text}}]]<!--
-->}}}}</span>}}}}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/>
-->}}}}</span>}}<!--
-->{{#ifexpr:{{#if:{{{sortkey|}}}|1|0}} or {{#ifeq:{{{sortkey}}}||1|0}}|</span>}}
}}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/>
{{{{FULLPAGENAME}}/doc}} }}</noinclude>
{{{{FULLPAGENAME}}/doc}} }}</noinclude>

2020年10月31日 (六) 11:40的版本

模板:Englishdoc

描述

此模板用于根据输入参数显示一个天气图标和对应的天气名称链接。主要用于信息框或表格中,以简洁的方式展示天气信息。

用法

使用以下代码来调用模板:

{{Weather inline|天气状况}}

若要自定义图标大小:

{{Weather inline|天气状况|width=图标宽度}}

参数

{{{1}}} (匿名参数)
必填。用于指定天气状况。此参数不区分大小写。可接受的值如下:
  • sun, sunny, 晴天, 晴 - 显示晴天图标和链接。
  • rain, rainy, 雨, 雨天 - 显示雨天图标和链接。
  • storm, 暴风雨, 风暴 - 显示雷雨图标和链接。
  • snow, 下雪, 雪天 - 显示雪天图标和链接。
  • springwind - 显示春季有花粉的刮风图标和链接。
  • fallwind - 显示秋季有落叶的刮风图标和链接。
  • all, any, both, 任何, 任意 - 显示“任意天气”的文本链接。
  • festival, 节日 - 显示节日图标和链接。
width
选填。用于指定图标的宽度,单位为像素。如果省略,则默认为 16px。

示例

输入代码 显示效果
{{Weather inline|sun}}  晴天
{{Weather inline|暴风雨|width=24px}}  雷雨
{{Weather inline|任意}} 任意天气
{{Weather inline|festival}}  s:节日