Template talk:InsectuxStatBlockFlora

For, I am sure a few reasons, this template is not working. Please do not correct, instead please explain why it is not working so that other templates will not run into the same problem. The intended design is: File:InsectuxStatBlock Flora.png--Mr. Gaunt (talk) 02:32, 28 June 2013 (UTC)


 * What's not working about it, exactly? I can probably explain to you what's wrong if you make a page with the desired input to the template, then I can see why it's not getting the desired output. Surgo (talk) 02:35, 28 June 2013 (UTC)


 * Click edit on page (shows input), and see file for desired output.--Mr. Gaunt (talk) 02:41, 28 June 2013 (UTC)


 * Also, Flora Stats explains possible values, and has notes.


 * Your #if statements are only hiding the first column value, not the whole row. That's why you see a bunch of extra colons floating around when those optional fields are left off. Making conditional rows in tables is really annoying, because:


 * You need to include all of the row syntax within the if statement so that the whole row is hidden. Unfortunately the if operator will see the |s in the table syntax and try to parse them because that's how it's written.
 * If you want to pass a | character within a template or operator, you need to instead use | (a template that evaluates to | eventually) so that the template or operator doesn't treat it as a value switch or whatever. So you need to use | instead of | for table syntax within an if statement.
 * You generally need to have table syntax in very specific places and the if statement ignores initial whitespace and linebreaks in it's T/F outputs, so you need to give it a real character (&_nbsp; (without the underscore) is my prefered forced character, since it evaluates to a 'non-breaking space' and doesn't mess with formatting most of the time) before you start the table syntax. Then it evaluates that character and the newline immediately after it and everything gets put in the right place.
 * You need to start the if statement immediately after the preceding bits, else you wind up with extra line break whitespace in the table.


 * So here's a brief example of what you need to do:




 * Hopefully that answers your question in the manner you desired, a complete answer without doing too much of the work for you. - Tarkisflux Talk 04:28, 28 June 2013 (UTC)


 * Still not working, tried your method, must have missed something. Then tried splitting it up (to remove most if statements), can see it now, but not in the right format. Could someone fix, so the problem) can be seen? Thank you --Mr. Gaunt (talk) 02:19, 1 July 2013 (UTC)


 * Sorted it. I used the method above to hide the fields that aren't used in cases A and B, so you can just use the one template for cases A, B, and C and just leave off the unnecessary fields. It wasn't working for some of the fields because you have nested conditionals, and that's a bit more complicated and requires multiple of the above code blocks at specific places within the if statement structure. It also needs another | that I wasn't showing before. I've added it above, if you want to try to follow the logic of what I did to the pages. - Tarkisflux Talk 04:00, 1 July 2013 (UTC)


 * The Buff/Poison case is more complicated than that though. You can't get it to show by just using the above code blocks in the indicated places, and have to do another test right after the first test to determine what the row name is supposed to be and what to show. Good tiems. - Tarkisflux Talk 04:04, 1 July 2013 (UTC)


 * Thank you, how do you make it look like Template:InsectuxStatBlock? --Mr. Gaunt (talk) 04:36, 1 July 2013 (UTC)


 * Like that you mean? Preceding and trailing includeonly tags, followed by a non-included documentation call, and then a filled in doc subpage. - Tarkisflux Talk 21:20, 1 July 2013 (UTC)