User:Thedjatclubrock/ifinfo

Re:
Here's the syntax for using the "if" ParserFunction: Now, the #if: function is somewhat of a nuisance, because it's written like this: "If the parameter in the condition section exists, then I display the true text. Otherwise, I display the false text." It cannot be used for equations (such as if parameter 1 is "2" or whatever). So, if I were to write a template "test" with the code  , here's what would happen.

Since that's somewhat restrictive in what you can do with it, there are other ParserFunctions that allow you to do a bit more. #ifeq: is written so that you can base the true/false condition on what a parameter equals. For example, I can tell #ifeq: to display one line of text if a parameter is equal to something, but display another line of text if the parameter is equal to something else. Here's the syntax: The comparison text is what the function will check the parameter against to see if they are equal. If they are, the true text is displayed. If not, the false text is displayed. So, let's say I re-write my template "test" to contain the following code:   Here's what would happen: Those two functions are probably the most commonly used, however there are others which do different things if you need them. For more information on how to use these two functions I've shown you, as well as the others, check out m:Help:ParserFunctions. If have any more questions, just let me know on my talk page. Happy editing! Hers fold  (t/a/c) 18:29, 10 August 2007 (UTC)