Part 2.0 - MediaWiki Syntax

From Training Material
Jump to: navigation, search

Parser and Tag Functions⌘

We've already seen some tag functions, such as <nowiki> </nowiki>

Parser functions look like this:

{{localurl:MediaWiki Syntax}}

/training/MediaWiki_Syntax

{{lc:MediaWiki Syntax}}

mediawiki syntax


You can parse parameters into a parser function:

{{#dateformat:2014-10-09|ymd}}

2014 October 9

If you want to input a parameter containing a pipe |, you can create a template containing only | and include it.

http://www.mediawiki.org/wiki/Help:Magic_words

Variables⌘

They are Uppercase and surrounded with curly braces.

They usually supply information about the page the wiki, or the Date/Time.

Behaviour Switches⌘

These are written in Uppercase and surrounded by double underscores.

They allow you to switch cetain behaviours of a page on an off.

e.g.

__NOTOC__ stops a table of content showing

Exercise ⌘

  • Add a date to the bottom of your page using variables
  • Add a date in specific format to page using parser function.
  • Enable Table of contents.
  • Create separate pages for the different cheeses listed on your cheese page (pick 3)