Bulbapedia talk:Project Moves and Abilities: Difference between revisions

Line 605: Line 605:
:Though staff don't want to use too many parser functions, I would think they would much prefer adding a parser function (testing if the power is "—" should mostly suffice) to {{template|MoveInfobox}} over editing 600+ pages.
:Though staff don't want to use too many parser functions, I would think they would much prefer adding a parser function (testing if the power is "—" should mostly suffice) to {{template|MoveInfobox}} over editing 600+ pages.
:That said, I tend to feel that sorting the table on [[List of moves]] is enough. [[User:Tiddlywinks|Tiddlywinks]] ([[User talk:Tiddlywinks|talk]]) 08:26, 17 July 2015 (UTC)
:That said, I tend to feel that sorting the table on [[List of moves]] is enough. [[User:Tiddlywinks|Tiddlywinks]] ([[User talk:Tiddlywinks|talk]]) 08:26, 17 July 2015 (UTC)
::I'm aware of the [[List of moves]] page, but this type of categorization will make it easier to navigate to similar moves. We already categorize Pokemon by their base stat totals (which is at most as important as a Move's power), yet there's a separate list for that as well. The current problem with parser functions is that we have too many types of non-integer inputs for the "power" field in the infobox.
::Anyways, I tested this function for the current [[:Template:MoveInfobox|MoveInfobox template]], simply by adding it to the ''includeonly'' tags. This will automatically categorize the move if and only if the power field is an integer. Thus, values such as "-" and "Varies" and "<nowiki>{{tt|420|88 in gen VII}}</nowiki>" would not be counted for.
::<code><nowiki>{{#iferror: {{#ifexpr: {{{power}}} > 0}}||[[Category: Moves with a power of {{{power}}}]]}}</nowiki></code>
::I know that because of this, moves with notes due to inter-generation changes will not be affected. One solution is to slightly change the MoveInfobox template so that power and notes regarding power are separate fields, so that the parser function can eventually work for all moves with a numeric power. This can be done cleanly, since moves without notes on their power will be unaffected, and moves that need to be changed will not look different until manually changed. [[User:TehPerson|TehPerson]] ([[User talk:TehPerson|talk]]) 14:58, 17 July 2015 (UTC)