User talk:Pokemaster97: Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
Line 311: Line 311:


Thank you for considering my request. — [[User:Randomwaffle23|Randomwaffle23]] ([[User talk:Randomwaffle23|talk]]) 19:33, 18 October 2018 (UTC)
Thank you for considering my request. — [[User:Randomwaffle23|Randomwaffle23]] ([[User talk:Randomwaffle23|talk]]) 19:33, 18 October 2018 (UTC)
== Template wikicode question ==
I am writing a sandboxed version of the {{tl|alldex}} row template for use on a draft article ([[User:Force Fire/List of Pokémon that appear in multiple regional Pokédex]]) that is currently nominated for mainspacing. I want this sandboxed version to take into account whether a non-numeric input (like <code>---</code> or <code>???</code>) is fed to any of its parameters.
On the current version in templatespace, whenever a non-numeric input is fed to the <code>s=</code> parameter, as in the following example:
<pre>{{alldexh|1}}
{{alldex|1|084|j=204|oj=199|h=095|oh=092|s=---|u2dex=---|kdex=094|kr=Central|adex=---|Doduo|2|Normal|Flying}}
|}</pre>
I get the following error message:
{{alldexh|1}}
{{alldex|1|084|j=204|oj=199|h=095|oh=092|s=---|u2dex=---|kdex=094|kr=Central|adex=---|Doduo|2|Normal|Flying}}
|}
This is because of the following numeric comparison statement being executed by the template to determine whether or not to append {{sup/4|Pt}} to the Sdex number:
<pre>{{#ifexpr: {{{s|001}}} > 151|{{Sup/4|Pt}}}}</pre>
The comparison <code><nowiki>{{{s|001}}} > 151</nowiki></code> crashes whenever <code>s=</code> is non-numeric. So, I want to modify my sandboxed copy of {{tl|alldex}} to not execute the numeric comparison above unless the input is purely numeric.
I want to ask if there is a wikicode command (like <code><nowiki>{{#ifnum: {{{in|def}}}|out}}</nowiki></code> or similar) that I can use in my template to check whether the input is a number (positive, negative, etc.) and execute the output only upon meeting that numeric constraint. That way, I could have my template do this without crashing or returning error messages:
<pre>{{#ifnum: {{{s|001}}}|{{#ifexpr: {{{s|001}}} > 151|{{Sup/4|Pt}}}}}}</pre>
I could also use such a construct to tell the template to supress any <code><nowiki>{{tt|*|}}</nowiki></code> tooltips for non-numeric inputs (like <code>---</code>, used to express that a Pokémon is not in that regional Pokédex), so that for the example above I get something like this:
{{alldexh|1}}
|- style="background:#FFFFFF;"
| style="font-family:Monospace;" | #084
| style="font-family:Monospace;" | #084
| style="font-family:Monospace;" | #204{{tt|*|199 in Generation II}}
| style="font-family:Monospace;" | #095{{tt|*|092 in Generation III}}
| style="font-family:Monospace;" | #---
| style="font-family:Monospace;" | #---
| style="font-family:Monospace;" | #094{{tt|*|Central}}
| style="font-family:Monospace;" | #---
| {{MS|084|Doduo (Pokémon)}}
| {{p|Doduo}}
| style="text-align:center; background:#{{normal color}}" | [[Normal (type)|<span style="color:#FFFFFF">Normal</span>]]
| style="text-align:center; background:#{{flying color}}" | [[Flying (type)|<span style="color:#FFFFFF">Flying</span>]]
|}
Any help on this? Thankee! &#x200b;‑‑[[User:SilSinn9801|''<b style="color:red">SilSinn</b>'']] ([[TID]]s: '''768426[[Pokémon Sun|<sup style="color:#F1912B">S</sup>]]''', '''123446[[Pokémon Ultra Moon|<sup style="color:#226DB5">UM</sup>]]''') [[User talk:SilSinn9801|&#x1F4AC;]] 22:46, 2 March 2019 (UTC)

Revision as of 22:46, 2 March 2019

Archive 1 Archive 2 Archive 3 Archive 4


015