By looking through the SkinTemplate.php
file in your MediaWiki install's directory, you can find lots of useful functions to extend the information you can dynamically insert in your wiki pages.
The SkinTemplate.php
file contains "global variables" that you can insert in your wiki page using this simple PHP:
<?php echo $GLOBALS['name_of_global_variable']; ?>
The echo
command inserts the value returned from the $GLOBALS
that follows it. The following are the variables you can use:
wgTitle
inserts the current page's title.wgScript
inserts your MediaWiki installation's script path. The script path is the part of the URL before your page title. For example, if your wiki was installed in the directorywiki/
on your website, the script path would bewiki/index.php
.wgStylePath
inserts your wiki's skins directory.wgContLanguageCode
inserts the ISO language code of the content. In most cases, it will be "en" for English.wgMimeType
inserts the MIME...