JDOC

Difference between revisions of "Local wiki extensions"

From Joomla! Documentation

(New page: Extensions are additions to the MediaWiki code that perform special functions. ===Syntax Highlighting=== The Geshi syntax-highlighter extension has been installed on this wiki. For PHP c...)
 
Line 23: Line 23:
  
 
===Additional Parser Functions===
 
===Additional Parser Functions===
The ParserFunctions extension has been added.  This extension provides the following additional functions:-
+
The ParserFunctions extension has been added.  This extension provides the following additional [http://meta.wikimedia.org/wiki/Help:Parser_function parser functions]:-
 
* #expr: computes simple mathematical expressions;
 
* #expr: computes simple mathematical expressions;
 
* #if: if-then-else construct;
 
* #if: if-then-else construct;

Revision as of 12:56, 17 January 2008

Extensions are additions to the MediaWiki code that perform special functions.

Syntax Highlighting[edit]

The Geshi syntax-highlighter extension has been installed on this wiki. For PHP code use <source lang="php">Your PHP code here</source>. Further information can be found here.

For example, inserting the following in your wiki page:

<source lang="php">
<?php
  echo "Hello World\n";
?>
</source>

will result in:

<?php
  echo "Hello World\n";
?>

Additional Parser Functions[edit]

The ParserFunctions extension has been added. This extension provides the following additional parser functions:-

  • #expr: computes simple mathematical expressions;
  • #if: if-then-else construct;
  • #ifeq: compares two strings or numbers;
  • #ifexists: determines if a particular page exists;
  • #ifexpr: evaluates and expression and tests the result;
  • #switch: switch/case statement;
  • #time: time and date formatting function;
  • #rel2abs: converts a relative to an absolute path;
  • #titleparts: extracts parts of a page title.

Full documentation for these functions can be found here.