Template:Weather inline: Difference between revisions
Appearance
imported>Nebulous Maestress m delete duplicate html comment |
imported>Nebulous Maestress switch to new way of handling sortkey, add {{{space}}} |
||
| Line 26: | Line 26: | ||
-->{{#arraydefine:$wlink_text|{{ParseInputValues|code=weather|@weather@|translate=true}}}}<!-- | -->{{#arraydefine:$wlink_text|{{ParseInputValues|code=weather|@weather@|translate=true}}}}<!-- | ||
// | // 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 | ||
| •  | |{{{space| • }}} | ||
|{{#if:{{{sortkey|}}}| | |{{#ifexpr:{{#if:{{{sortkey|}}}|1|0}} or {{#ifeq:{{{sortkey}}}||1|0}} | ||
<span | |<span data-sort-value="{{#ifeq:{{{sortkey}}}|||{{#ifeq:{{{sortkey|true}}}|true | ||
|{{#expr:{{#if:{{#arrayprint:$wlink_text}} | |||
|({{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"><!-- | ||
| Line 49: | Line 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> | ||
Revision as of 23:07, 27 October 2020
Description
This template displays the icon for the type of weather, plus a link to the associated wiki page.
Use
{{Weather inline|type of weather|width (optional)}}
Valid Parameters
There are 9 valid types of weather. All are case-insensitive.
- All / Any = Template:ParseInputValues[[File:Template:ParseInputValues.png|
| link=Weather| alt=]] [[Weather|Template:ParseInputValues]]
- Sun = Template:ParseInputValues[[File:Template:ParseInputValues.png|
| link=Weather| alt=]] [[Weather|Template:ParseInputValues]]
- Springwind = Template:ParseInputValues[[File:Template:ParseInputValues.png|
| link=Weather| alt=]] [[Weather|Template:ParseInputValues]]
- Fallwind = Template:ParseInputValues[[File:Template:ParseInputValues.png|
| link=Weather| alt=]] [[Weather|Template:ParseInputValues]]
- Rain = Template:ParseInputValues[[File:Template:ParseInputValues.png|
| link=Weather| alt=]] [[Weather|Template:ParseInputValues]]
- Storm = Template:ParseInputValues[[File:Template:ParseInputValues.png|
| link=Weather| alt=]] [[Weather|Template:ParseInputValues]]
- Snow = Template:ParseInputValues[[File:Template:ParseInputValues.png|
| link=Weather| alt=]] [[Weather|Template:ParseInputValues]]
- Festival = Template:ParseInputValues[[File:Template:ParseInputValues.png|
| link=Weather| alt=]] [[Weather|Template:ParseInputValues]]
Width
Specify the width in pixels, and include "px".
{{Weather inline|Snow|width=24px}}
Template:ParseInputValues[[File:Template:ParseInputValues.png|
| link=Weather| alt=]] [[Weather|Template:ParseInputValues]]