Изменения

Перейти к: навигация, поиск

Справка:Функции парсера

21 байт убрано, 19:53, 28 января 2010
м
Нет описания правки
The {{mediawiki|Extension:ParserFunctions|ParserFunctions}} extension provides ten additional parser functions to supplement the "[[СправкаHelp:Ключевые словаMagic words|magic words]]", which are already present in MediaWiki. All the parser functions provided by this extension take the form:
:<tt><nowiki>{{</nowiki> '''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ... <nowiki>}}</nowiki></tt>
:<tt><nowiki>{{#if: foo | | no}}</nowiki></tt> &rarr; ''' {{#if: foo | | no}}'''
See [[mediawikiwiki:Help:Parser functions in templates]] for more examples of this parser function.
==#ifeq==
:<tt><nowiki>{{#ifexist:</nowiki> XXX{{FULLPAGENAME}}XXX | exists | doesn't exist <nowiki>}}</nowiki></tt> &rarr; '''{{#ifexist: XXX{{FULLPAGENAME}}XXX | exists | doesn't exist }}'''
The function evaluates to true for [[mediawikiwiki:Help:System messages|system messages]] that have been customised, and for [[Help:Special pages|special pages]] that are defined by the software.
:<tt><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></tt> &rarr; '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}'''
:<tt><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></tt> &rarr; the code '''<tt><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></tt>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.
{{warning|The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as [[СправкаHelp:Ключевые словаMagic words|variables]] or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]].}}
===Tables ===
* [[mediawikiwiki:Extension:StringFunctions]]
[[Категория:Справка]]

Навигация