WikiDB/Tutorial

From TestWiki
< WikiDB
Revision as of 02:45, 9 July 2006 by HappyDog (Talk | contribs) (Better link - stop pre-tagged data being parsed)

Jump to: navigation, search

Step #1 - Defining Data

Suppose you have a standard infobox, say Template:Infobox company. You use it in a page by entering the following syntax:

Microsoft

Year founded: 1492
Annual Revenue: $8

Which gives the following result:

Microsoft

Year founded: 1492
Annual Revenue: $8

In order to add this table to a database, you simply replace the above syntax with the following:

<data table="Companies" template="Infobox company">
name=Microsoft
founded=1492
revenue=$8
</data>

This generates exactly the same output:

Microsoft

Year founded: 1492
Annual Revenue: $8

...BUT it also adds data to the Companies table. There is no definition for this table yet, but the data is there!

Data can be defined on any page in the wiki, and more than one row of data can be defined in a page. You get to group data with content, and still have it displayed in a standard format within the page.

You can omit the template parameter altogether, and the data will be hidden, or you can use the special name "default" to display the data in a standard format, as follows:

name founded revenue
Apple 1984 $7.42


Now, take a look at Table:Companies and you can see the above data in tabular form.