Heroes of the Storm Wiki

Semantic MediaWiki template variables

How do I configure the Template:Custom hero list to display each Template:Hero list item correctly in the Hero Prices page?

If you do not pass in the franchise, it will look it up for you (as seen in the docs page). But, when you use the template in an #ask lookup, it does not pass the franchise of the Hero down to the template. They all have a blank value.

— Thanks, Rmkane (talk) 15:12, 6 September 2017 (UTC)

I had the same problem when I was working on Template:Custom hero tile list, and after some trial and error and some perusing of the Semantic MediaWiki website, I was able to figure it out. The solution is that when working on passing an #ask into a template, you have to add in link = none. The reason for that is basically, after performing a search, the #ask function doesn't just return the name of the pages that fit the query, it returns a link to the page by default. This is normally good when you aren't using a template, but when you are, the #ask function will pass on a link (for example [[Abathur]]) to the template instead of just the name (Abathur). Since templates aren't coded to receive the square brackets as an input, it will cause them to behave strangely. Adding link = none removes the square brackets and causes the receiving template to behave as expected.
MetricTrout (talk) 22:53, 6 September 2017 (UTC)