Donnerstag, 12. März 2009

MediaWiki #if syntax

Whenever I work on our wiki I have to look up the #if syntax (esp. for the more complex cases) and just do not find the right page on mediawiki.org. So I use this page as my personal cheat sheet.javascript:void(0)

#if:
{{#if: | true | false}} → false
{{#if: string | true | false}} → true
{{#if: {{{TEMPLATEVAR|}}} | true | false}} → true if the TEMPLATEVAR has any value


#ifeq:
{{#ifeq: string1 | string2 | value if true (string1 == string2) | value if false (string1 != string2) }}
{{#ifeq:{{{TEMPLATEVAR|}}} | yes | ja | nein }}


The right page for documentation can be found here: http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions

0 Kommentare:

Kommentar veröffentlichen