Forum:Templates and

Hello, I'm working on a template w:c:wonderlandonline:Template: Pet, and after looking at some templates someone else built on the Wonderland Online wiki, I was able to learn how to use #if and #ifexist. But I'm not 100% sure about them, since I've read through the help pages on templates and didn't really see them mentioned anywhere.

From what I can tell, #if works something like this:, while #ifexist works in a similar way but the condition is to check whether or not the specified page exists in the wiki? Please correct me if I'm wrong.

Now, I'm not too sure on this, but it looks like #if only works on numeric variables. I'd like to use some sort of conditional check for a string. I want my template built so that when people use it they just plug in the info. Specifically, I have one line cell in my table that is supposed to show some text, but I'd prefer if it only showed up if it is specified when the template is used, and just shows "none" instead. So basically, what I wanted to ask is how can I check to see if a string exists or is null?

Any help would be appreciated, thanks!

--Deraxian 00:02, November 28, 2009 (UTC)


 * Err, after taking a look at http://en.wikipedia.org/wiki/Wikipedia:Anatomy_of_a_template#Conditionals and http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions, I think I understand it, sorry and nevermind. :-P
 * --Deraxian 00:54, November 28, 2009 (UTC)