Board Thread:Support Requests - Getting Technical/@comment-27704998-20160509142553/@comment-1881961-20160516163702

Sandrew26 wrote: Whew.

Okay, I've had a chance to sit down with the code for a while. The HeroStats template is very slick! I especially like how you can use one template for different types of visualizations depending on what mode you call. Thanks. That functionality could be further extended. For instance, what if the template was also providing his basic stats ("str","int","wis",etc). Maybe the "row" mode only returns what you see now. But there could be a "statrow" which gave his name and the 6 basic stats and/or a "fullrow" which provides everything.

Sandrew26 wrote: Now, I'm still a newb to this, so could I please ask you to explain why you need the Tasselhoff template? Couldn't you just use only the HeroStats template on an article page, then call that article page as as if it were a template? Mediawiki makes me think that might work, though there's still lots about this that I don't understand. Vengir has it right. It wouldn't HAVE to be a template. For instance, I could have created "Tasselhoff Burrfoot/Stats" and put a call to with his data there. However, the drawback to that is that I won't be able to process the mode parameter. By having I can call it and provide mode= to override the default behaviors.

Sandrew26 wrote: How does adding the Tasselhoff template to the Hero Table page populate the table when the Tasselhoff template link is just randomly on the page? I understand that the ifequal comparative in HeroStats returns false so it uses the second line, but I don't see how adding a line of table code to the page outside the table does anything. It isn't actually random, looking at the wikitext from that page... The call to is exactly where I would have typed in the wikitext for his row of data in the table.

Optionally, I could have included a leading new row ("|-") line in the "row" output mode. I go back and forth on that as sometimes I feel like it is more readable on the article page to see that you have a new row, then Tasslehoff, then a new row then Goldmoon, etc. Otherwise a new editor/author has to trace through the template stack to see whether the template provides the new row code or not.