Board Thread:General Discussion/@comment-4405461-20150317104235/@comment-1997905-20150317110353

I was expecting something more comprehensive from a page called "Parser functions in templates", but it's only talking about using pipes in template parameters.

All it's trying to explain is the difference between  and. Consider this template:

Parameter 1 is: Parameter 2 is:

If you were to write, you would get:

Parameter 1 is: foo Parameter 2 is: bar

Which is exactly what you'd expect. If you were to write, you would get:

Parameter 1 is: Parameter 2 is:

Parameter 2 doesn't show up at all because the pipe character is used to specify a default value. If there's no default value, you just get back the wikitext. If there is a default value - even if there's nothing between the pipe and the curly braces - you get whatever the default value is.

So, if you had:

Parameter 1 is: Parameter 2 is:

If you were to write, you would get:

Parameter 1 is: Parameter 2 is: bar

Because the default value for 2 is "bar". This is just the default for whenever it's not specified though. If you were to write, you would get:

Parameter 1 is: foo Parameter 2 is: blarg

What that help page is trying to point out is that you can use this in  parser functions. Realistically, it's pretty much required; they try to make it seem like it's supplementary but this is the single most common use case for. Documentation for that is at mw:Help:Extension:ParserFunctions. The short version is that  is "true" if the first parameter contains any text. Say you had the template:

Which is a simplified version of how infoboxes only show rows with values in them. If you were to write, you would get:

Parameter 1 is:

Which is not what you want. You want it to not show up unless someone specifies the first parameter. You get this instead because - as above - when no one specifies the first parameter, you get the literal text "". That counts as any text, so the  is true.

Instead, you want:

If you were to write, you would get:

If you were to write, you would get:

Parameter 1 is: foo

For more practical examples, try cracking open an infobox.