Valve Developer Community:Sandbox: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Replaced content with '<!-- Do not edit this line! -->{{sandbox}}<!-- Don't you dare! --> {{subst:Mod Page}}')
m (Undo revision 137620 by Roob (Talk))
Line 1: Line 1:
<!-- Do not edit this line! -->{{sandbox}}<!-- Don't you dare! -->
<!-- Do not edit this line! -->{{sandbox}}<!-- Don't you dare! -->
{{ModStatus|status=Alpha|engine=Source|download=}}
__FORCETOC__
 
==Parser extension tags==
== Overview ==
newsblurbs:<newsblurbs>dfgdfg dfgdfg dfgdfg</newsblurbs>
 
nframe:<nframe>dfgdfg dfgdfg dfg</nframe>
Start with a mod description. This should be a general overview of what the mod is and maybe what
pre:<pre>dfgdfg dfgdf
sets it apart from other mods in its genre. This is broad information and can include what the mod
dfgdfg dfgfgdf
is now as well as what is intended for the future.
dfgdf fdggd</pre>
 
source:<source lang="php"><?php
== Features ==
 
# Define a setup function
* a quick list of features
$wgExtensionFunctions[] = 'efExampleParserFunction_Setup';
* bulleted lists are always nice
# Add a hook to initialise the magic word
* they give the viewer a quick overview of what is in the mod
$wgHooks['LanguageGetMagic'][]      = 'efExampleParserFunction_Magic';
* you don't need to list every minute feature here
 
function efExampleParserFunction_Setup() {
== Media ==
        global $wgParser;
 
        # Set a function hook associating the "example" magic word with our function
Screenshots, movies, whatever. We are almost requiring media for a mod to be listed- it's not a
        $wgParser->setFunctionHook( 'example', 'efExampleParserFunction_Render' );
steadfast rule, but it's a good idea of when to decide to make your mod's page.
}
 
== History ==
function efExampleParserFunction_Magic( &$magicWords, $langCode ) {
 
        # Add the magic word
A brief history of the mod.  How long has it been around, what kind of changes has it gone through,
        # The first array element is case sensitive, in this case it is not case sensitive
what problems had to be overcome.  You know.  Whatever. If you want it.
        # All remaining elements are synonyms for our parser function
 
        $magicWords['example'] = array( 0, 'example' );
== Team ==
        # unless we return true, other parser functions extensions won't get loaded.
 
        return true;
Some information about the mod team.
}
 
== Localized versions ==
function efExampleParserFunction_Render( &$parser, $param1 = '', $param2 = '' ) {
 
        # The parser function itself
Information about the localized versions of the mod.
        # The input parameters are wikitext with templates expanded
 
        # The output should be wikitext too
== See also ==
        $output = "param1 is $param1 and param2 is $param2";
 
        return $output;
* Links to other related articles within the wiki (optional).
}
 
?></source>
== External links ==
==Parser function hooks==
 
* fullurl:{{fullurl:MDL|hi}}
* links to the official site
* urlencode:{{urlencode:123!"§}}
* links to mod specific tutorials on the wiki and externally
* uc:{{uc:x}}
* mod specific forums
* ucfirst:{{ucfirst:xyz}}
* etc
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
* {{moddb|Insert-ModDB-ID-number-here}}
 
[[Category:Help Wanted]]
[[Category:Multiplayer Mods]]
[[Category:Open Source Mods]]
[[Category:Released Mods]]
[[Category:Single Player Mods]]

Revision as of 06:41, 31 August 2010

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

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