Valve Developer Community:Sandbox
The Sandbox (Valve Developer Community:Sandbox) is a VDC namespace page designed for testing and experimenting with Wiki syntax. Feel free to try your skills at formatting here: click on edit, make your changes, and click 'Save page' when you are finished. Content added here will not stay permanently.
Please do not edit the "markup" text, at the top of the editing window, that reads "{{sandbox}}".
Parser extension tags
newsblurbs:<newsblurbs>dfgdfg dfgdfg dfgdfg</newsblurbs> nframe:<nframe>dfgdfg dfgdfg dfg</nframe>
pre:
dfgdfg dfgdf dfgdfg dfgfgdf dfgdf fdggd
source:
<?php
# Define a setup function
$wgExtensionFunctions[] = 'efExampleParserFunction_Setup';
# Add a hook to initialise the magic word
$wgHooks['LanguageGetMagic'][] = 'efExampleParserFunction_Magic';
function efExampleParserFunction_Setup() {
global $wgParser;
# Set a function hook associating the "example" magic word with our function
$wgParser->setFunctionHook( 'example', 'efExampleParserFunction_Render' );
}
function efExampleParserFunction_Magic( &$magicWords, $langCode ) {
# Add the magic word
# The first array element is case sensitive, in this case it is not case sensitive
# All remaining elements are synonyms for our parser function
$magicWords['example'] = array( 0, 'example' );
# unless we return true, other parser functions extensions won't get loaded.
return true;
}
function efExampleParserFunction_Render( &$parser, $param1 = '', $param2 = '' ) {
# The parser function itself
# The input parameters are wikitext with templates expanded
# The output should be wikitext too
$output = "param1 is $param1 and param2 is $param2";
return $output;
}
?>
Parser function hooks
- fullurl:https://developer.valvesoftware.com/w/index.php?title=MDL&hi
- urlencode:123%21%22%C2%A7
- uc:X
- ucfirst:Xyz
anchorencode, defaultsort, displaytitle, filepath, formatnum, fullurl, fullurle, grammar, int, language, lc, lcfirst, localurl, localurle, ns, numberofadmins, numberofarticles, numberofedits, numberoffiles, numberofpages, numberofusers, padleft, padright, pagesincategory, pagesize, plural, special, tag, uc, ucfirst and urlencode