Extension:ParserFunctions


Other languages:
català • ‎Deutsch • ‎English • ‎español • ‎suomi • ‎français • ‎हिन्दी • ‎italiano • ‎日本語 • ‎한국어 • ‎मराठी • ‎polski • ‎português • ‎português do Brasil • ‎русский • ‎sicilianu • ‎中文

Note Note: This extension is bundled with MediaWiki 1.18 and above. Thus you do not have to download and extract the extension as described. However, you still need to follow the other instructions provided.

MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
ParserFunctions

Release status:Extension status stable

ImplementationTemplate:Extension#type Parser function
DescriptionTemplate:Extension#description Enhances parser with logical and string functions
Author(s)Template:Extension#username Tim Starlingtalk
Latest versionTemplate:Extension#version 1.6.0 (2014-03-28)
MediaWikiTemplate:Extension#mediawiki 1.19+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download
README
ParametersTemplate:Extension#parameters
  • $wgPFStringLengthLimit
  • $wgPFEnableStringFunctions
Hooks usedTemplate:Extension#hook
ParserFirstCallInitManual:Hooks/ParserFirstCallInit
UnitTestsListManual:Hooks/UnitTestsList
ScribuntoExternalLibraries

Translate the ParserFunctions extension if it is available at translatewiki.net

Check usage and version matrix.

IssuesPhabricator

Open tasks · Report a bug

The ParserFunctions extension enhances the wikitext parser with helpful functions, mostly related to logic and string-handling. Since MediaWiki 1.15, ParserFunctions has incorporated most (but not all) of the functions from the StringFunctions extension, which may be enabled or disabled (See the install instructions below).

For instructions on how to use this extension, see the ParserFunctions help page, and the StringFunctions page.

InstallationEdit

  • Download and place the file(s) in a directory called ParserFunctions in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
wfLoadExtension( 'ParserFunctions' );
  • Configure as required, e.g. if you want to use the integrated string function functionality, add just after that line:
$wgPFEnableStringFunctions = true;
  •  Y Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing extensions using wfLoadExtension(), since MediaWiki 1.25. If you need to install this extension in earlier versions, instead of wfLoadExtension( 'ParserFunctions' );, you need to use:

require_once "$IP/extensions/ParserFunctions/ParserFunctions.php";

ConfigurationEdit

$wgPFEnableStringFunctions
Allows to activate the integrated string function functionality (see StringFunctions). The default value is false.
$wgPFStringLengthLimit
Defines the maximum length of a string that string functions are allowed to operate on. The default value is 1000.

See alsoEdit