Using Lists with MediaWiki
The three types of lists available in HTML—unordered lists, ordered lists, and definition lists—are also available in MediaWiki. In MediaWiki, we can use both HTML and wiki syntax for creating lists. We will explore both techniques in this article.
Creating unordered lists in MediaWiki is very simple. In order to create an unordered list in MediaWiki using wiki syntax, keep the following rules in mind:
- Use the asterisk (*) sign at the beginning of each line for creating a list element. The number of asterisks you add before the line will indicate the level of list element in the unordered list. For example, ** will indicate a second-level list element, while *** will indicate a third-level list element, and so on.
- In order to restart an unordered list, put a wiki line break (an empty line) at the end of the list. Then you can start another list using *.
Let’s open a new page and write the following content in order to create an unordered list:
* Ghost Directory - North America:
** United States of America.
*** New York.
**** Long Island
**** Cooney Island
*** New Jersey
* Ghost Directory - Europe:
** United Kingdom
Now let’s click on Save page to see the unordered lists that we have created:
Now let us see how to create the same list using HTML syntax:
<ul><li>Ghost Directory - North America :
<ul><li>United States of America.
<li> New York.
<li> New Jersey
<ul><li> Ghost Directory - Europe:
<ul><li> United Kingdom
From the previous two examples we see that the wiki syntax definitely gives us a less hard time generating the unordered list.
The basic difference between unordered and ordered lists is that while we see only bullets for unordered lists, in an ordered list we will see numbers like 1,2… etc. In order to create an ordered list in MediaWiki using wiki syntax, keep the following rules in mind:
- Use the hash (#) sign for creating each list element. The number of hashes you add before the line will indicate the level of list element in the ordered list. For example, ## will indicate a second-level list element, ### will indicate a third-level list element, and so on.
- In order to restart an ordered list, put a blank line at the end of the list. Then you can then start another list using #.
Now look at the following example in MediaWiki to create an ordered list:
In order to submit your story for the Monthly Haunted story contest, you have to follow the
Stories can have the following Categories
# Short Story
# Real life story
Here are the writing guidelines
# Basic Guidelines
## Story must be within 1200 words.
## Computer Typed:
### Font size: 12 pt
### Paragraph: double line break
### Font Name: Times New Roman
## Well formatted with a front page
## Front page content:
### Story name
### Author Name
### Submission Date
### Author Email Address
# All entries must be submitted before 1st October, 2006
# For any query, contact [email protected]
Click on Save page to see the ordered list, which appears as shown below:
Now if the same example is created with HTML tags, we will see that the wiki syntax is much easier to apply than HTML syntax.
However, there still are some places where we have to use HTML instead of wiki syntax. Take this example: we have a list of ghost sighting for the last 100 years starting from early 1900s. We want to show the sightings sequentially using the years rather than 1, 2, 3, etc. In MediaWiki all ordered lists start from 1, and we cannot define any attribute for wiki syntax. Hence it is not possible for us to start with predefined numbering. Maybe future MediaWiki versions will have something to accommodate this feature.
So let’s see how we can perform the task with HTML:
Here is the list of ghost sightings in the last 100 years
<li> Ghosts Sighted in Year 1905
<ol><li>3rd January: Ghost of ancient Mariner sighted at Port City,
<li>10th January: Ghost of a Little girl sighted at a village
<li>5th May: A werewolf sighted in a mountain region of
<li>25th December: A Christmas ghost sighted in Texas
<li> Ghosts Sighted in Year 1906
<ol><li> 3 sightings have been reported but details about place and
time are not available.
<li> Ghosts Sighted in Year 1907
<ol><li>3rd January: Ghost of ancient Mariner sighted again after
2 years at Port City, Florida, USA
<li>11th June: Ghost of a Mathematician sighted at an old
<li> Ghosts Sighted in Year 1937
<ol><li>January, First Vampire existence found in United Kingdom
<li>April, A sailor ghost was sighted on a ship bound to
USA from UK
<li> July, The sailor ghost again sighted on a ship bound to
USA from UK - it was named Atlantic Nightmare.
Click on Save page to see the output as shown in the following screenshot:
So, from the previous example, we see that it’s better to use HTML tags in special cases, where wiki syntax is not of much help. This is the reason why MediaWiki allows the use of HTML tags for formatting.