Forum:Link brackets, categories and variables

From Warcraft Wiki
Jump to navigation Jump to search
Forums: Village pump → Link brackets, categories and variables
(This topic is archived. Please do not edit this page!)

Okay, what I'm trying to do is add some more functionality to the {{Tcgcard}} template, by having it automatically put cards in categories for type, class and/or race (so Category:TCG dwarf allies, Category:TCG rogue abilities, etc). However, most of the TCG cards have had their variables saved as links (so with brackets), meaning that I can't just parse them in the category name. Anyone got a solution that doesn't require me to edit a few hundred cards manually to remove the links?--Ijffdrie (talk) 12:06, 26 March 2013 (UTC)

Take a look at what I did in {{tcgcard/dev}} at the end of the template. I've got a live example using the /dev template up at Grennan Stormspeaker. You can use the same double-replace technique to strip out brackets elsewhere too. Most of the admins have bots that can strip out internal links if you want, going from |race=[[Tauren]] to |race=Tauren, so if you want that kind of edit done, we can handle that for you.
As an aside, you've been doing an awesome job getting all of the cards documented on the wiki. Keep up the good work! --k_d3 17:16, 26 March 2013 (UTC)
Thanks for the compliment.
However, I'm still not able to fully get it working. Specifically, I'm having trouble created nested ifs (having it first check whether type is ally, and then putting it in a category for race and class). Any advice on that one?--Ijffdrie (talk) 18:37, 4 April 2013 (UTC)